René's URL Explorer Experiment


Title: WIP: Discovery API by lmangani · Pull Request #12 · Query-farm/httpserver · GitHub

Open Graph Title: WIP: Discovery API by lmangani · Pull Request #12 · Query-farm/httpserver

X Title: WIP: Discovery API by lmangani · Pull Request #12 · Query-farm/httpserver

Description: Discovery API ⚠️ This is just an experiment and will most likely end up in a different extension The optional discovery API offers an easy hook for servers to advertise and discover each other (flock) Endpoints POST /subscribe/{secretHash} - Register a peer GET /discovery/{secretHash} - Get list of active peers DELETE /unsubscribe/{secretHash}/{peerId} - Remove peer Start Server w. DUCKDB_HTTPSERVER_DISCOVERY=1 D SELECT httpserve_start('0.0.0.0',9999, ''); ┌──────────────────────────────────────┐ │ httpserve_start('0.0.0.0', 9999, '') │ │ varchar │ ├──────────────────────────────────────┤ │ HTTP server started on 0.0.0.0:9999 │ └──────────────────────────────────────┘ Register a Peer under a secret hash CURL curl -X POST "https://localhost:9999/subscribe/secretHash" \ -H "Content-Type: application/json" \ -d '{ "name": "service1", "endpoint": "http://192.168.1.100:8080", "ttl": 300 } SQL INSTALL http_client FROM community; LOAD http_client; LOAD json; WITH __input AS ( SELECT http_post( 'http://localhost:9999/subscribe/secretHash', headers => MAP { }, params => MAP { 'name': 'quackpipe1', 'endpoint': 'https://1.1.1.1', } ) AS res ) SELECT res->>'reason' as res, res->>'status' as status FROM __input; Check peers table D SELECT name, endpoint, source_address as sourceAddress, peer_id as peerId, metadata, ttl, strftime(registered_at, '%Y-%m-%d %H:%M:%S') as registered_at FROM peers WHERE hash = 'secretHash'; ┌──────────┬───────────────────────────┬───────────────┬──────────────────────────────────┬──────────┬───────┬─────────────────────┐ │ name │ endpoint │ sourceAddress │ peerId │ metadata │ ttl │ registered_at │ │ varchar │ varchar │ varchar │ varchar │ varchar │ int64 │ varchar │ ├──────────┼───────────────────────────┼───────────────┼──────────────────────────────────┼──────────┼───────┼─────────────────────┤ │ service1 │ http://192.168.1.100:8080 │ xxx.xx.xx.xxx │ 0872c98634ce7e608e19aa1a1e6cf784 │ {} │ 300 │ 2024-11-14 19:44:23 │ └──────────┴───────────────────────────┴───────────────┴──────────────────────────────────┴──────────┴───────┴─────────────────────┘ Discover Peers CURL curl "http://localhost:9999/discovery/secretHash" SQL D SELECT * FROM read_ndjson_auto('http://localhost:9999/discovery/secretHash'); ┌──────────┬──────────────────────┬────────────────┬──────────────────────────────┬──────────┬─────────┬─────────────────────┐ │ name │ endpoint │ source_address │ peer_id │ metadata │ ttl │ registered_at │ │ varchar │ varchar │ varchar │ uuid │ varchar │ varchar │ timestamp │ ├──────────┼──────────────────────┼────────────────┼──────────────────────────────┼──────────┼─────────┼─────────────────────┤ │ service1 │ http://192.168.1.1… │ 127.0.0.1 │ 0872c986-34ce-7e60-8e19-aa… │ │ 3600 │ 2024-11-15 14:13:50 │ └──────────┴──────────────────────┴────────────────┴──────────────────────────────┴──────────┴─────────┴─────────────────────┘ D ⚠️ minor issue with peer_id being a UUID and python hating it

Open Graph Description: Discovery API ⚠️ This is just an experiment and will most likely end up in a different extension The optional discovery API offers an easy hook for servers to advertise and discover each other (fl...

X Description: Discovery API ⚠️ This is just an experiment and will most likely end up in a different extension The optional discovery API offers an easy hook for servers to advertise and discover each other (fl...

Opengraph URL: https://github.com/Query-farm/httpserver/pull/12

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:d30916d0-0fa0-08fa-8750-ca3da83a5316
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8294:1788C3:255DC2:311E5D:698280EA
html-safe-noncea0a3f572129e1fa6516f0b16af30f2e1d97cde08ddb845874de2a2ce5de72d55
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Mjk0OjE3ODhDMzoyNTVEQzI6MzExRTVEOjY5ODI4MEVBIiwidmlzaXRvcl9pZCI6IjE5MDY5MDM1OTkzMDUzNTk1OTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac611ae15042bdf077ba56f36adbefccf7f890dfc3944ac10962322d2a5cbe9207
hovercard-subject-tagpull_request:2180631466
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/Query-farm/httpserver/pull/12/files
twitter:imagehttps://avatars.githubusercontent.com/u/1423657?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1423657?s=400&v=4
og:image:altDiscovery API ⚠️ This is just an experiment and will most likely end up in a different extension The optional discovery API offers an easy hook for servers to advertise and discover each other (fl...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None502ff2009aec8671c806fca4ec6d758f90b6b96901b01d5f0ed23cc438efdf0f
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/Query-farm/httpserver git https://github.com/Query-farm/httpserver.git
octolytics-dimension-user_id183420031
octolytics-dimension-user_loginQuery-farm
octolytics-dimension-repository_id869750358
octolytics-dimension-repository_nwoQuery-farm/httpserver
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id869750358
octolytics-dimension-repository_network_root_nwoQuery-farm/httpserver
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2e7b93cf13221e895180e11ba3b1028b0b71f0ac
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FQuery-farm%2Fhttpserver%2Fpull%2F12%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FQuery-farm%2Fhttpserver%2Fpull%2F12%2Ffiles
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=Query-farm%2Fhttpserver
Reloadhttps://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes
Reloadhttps://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes
Reloadhttps://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes
Query-farm https://patch-diff.githubusercontent.com/Query-farm
httpserverhttps://patch-diff.githubusercontent.com/Query-farm/httpserver
duckdb/extension-templatehttps://patch-diff.githubusercontent.com/duckdb/extension-template
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FQuery-farm%2Fhttpserver
Fork 10 https://patch-diff.githubusercontent.com/login?return_to=%2FQuery-farm%2Fhttpserver
Star 265 https://patch-diff.githubusercontent.com/login?return_to=%2FQuery-farm%2Fhttpserver
Code https://patch-diff.githubusercontent.com/Query-farm/httpserver
Issues 10 https://patch-diff.githubusercontent.com/Query-farm/httpserver/issues
Pull requests 1 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pulls
Actions https://patch-diff.githubusercontent.com/Query-farm/httpserver/actions
Security 0 https://patch-diff.githubusercontent.com/Query-farm/httpserver/security
Insights https://patch-diff.githubusercontent.com/Query-farm/httpserver/pulse
Code https://patch-diff.githubusercontent.com/Query-farm/httpserver
Issues https://patch-diff.githubusercontent.com/Query-farm/httpserver/issues
Pull requests https://patch-diff.githubusercontent.com/Query-farm/httpserver/pulls
Actions https://patch-diff.githubusercontent.com/Query-farm/httpserver/actions
Security https://patch-diff.githubusercontent.com/Query-farm/httpserver/security
Insights https://patch-diff.githubusercontent.com/Query-farm/httpserver/pulse
Sign up for GitHub https://patch-diff.githubusercontent.com/signup?return_to=%2FQuery-farm%2Fhttpserver%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://patch-diff.githubusercontent.com/login?return_to=%2FQuery-farm%2Fhttpserver%2Fissues%2Fnew%2Fchoose
lmanganihttps://patch-diff.githubusercontent.com/lmangani
mainhttps://patch-diff.githubusercontent.com/Query-farm/httpserver/tree/main
discoveryhttps://patch-diff.githubusercontent.com/Query-farm/httpserver/tree/discovery
Conversation 0 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12
Commits 14 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/commits
Checks 72 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/checks
Files changed https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/files
Please reload this pagehttps://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes
WIP: Discovery API https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes#top
Show all changes 14 commits https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/files
6d7a211 discovery api lmangani Nov 14, 2024 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/commits/6d7a21194153a7910512b86ecb56095fa6bc2816
11970f3 remove debug lmangani Nov 14, 2024 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/commits/11970f347edbf8ddf19f226d6199be92c8e40236
39ab52e one step ahead lmangani Nov 14, 2024 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/commits/39ab52e9eeb5b50584d6636fe468c4195297e820
03e844e no crash, no results lmangani Nov 14, 2024 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/commits/03e844e7a71ed85d5787555a8ac93ba89bffd97f
3c4990d QueryResult -> MaterializedQueryResult fix akvlad Nov 15, 2024 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/commits/3c4990dc1ab31ea565fa91b00391e5d460626fca
a8dc4bb format handlers for /disco lmangani Nov 15, 2024 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/commits/a8dc4bbc587d90902dcb2ea2829cb909b7f24283
a9db01e Merge branch 'main' into discovery lmangani Nov 15, 2024 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/commits/a9db01ef3d3b7d09d6db76ecfb5568da929ab50a
4698e5b v1.1.3 + ENV settings lmangani Nov 16, 2024 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/commits/4698e5b6d8d5366899735e2bd7ffa14cc00b3d4b
bb34a9f Windows setenv handler lmangani Nov 16, 2024 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/commits/bb34a9f8ed2e580e40c715fe08fe5d4d9125946f
7c79076 Fix WIN32 _putenv_s lmangani Nov 16, 2024 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/commits/7c7907618cb26bfd5af7d3e00905f72907e65f79
db6b7d1 Damn you WIN32 lmangani Nov 16, 2024 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/commits/db6b7d1c89ebfe0beeb1b44436089fbca977fe6f
8ce6b34 WIN-WIN32 lmangani Nov 16, 2024 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/commits/8ce6b344c8ae233b83881646a47ed038b9289b7e
370862e Create DISCOVERY.md lmangani Nov 16, 2024 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/commits/370862ee946fa603af1741bd1fd0ecac49ed487b
bdfe781 Merge branch 'main' into discovery lmangani Dec 8, 2024 https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/commits/bdfe7819b57592d0c0bb258d4823395162b96f75
Clear filters https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/files
Please reload this pagehttps://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes
Please reload this pagehttps://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes
CMakeLists.txt https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes#diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20a
DISCOVERY.md https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes#diff-e5ce7a400706263a38ec306bc982616275cd778a13e5bf0b1d41bf4bb8d1a37a
discovery.cpp https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes#diff-0495e390238c18d6cb7f4f5795ef8ed489b00ca7f70cab78c5b9f55effa45f2d
httpserver_extension.cpp https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes#diff-a5831875febd343fed51f5e6a626c8c37fafe8eb053ea68e1aff2f7e17b218d5
discovery.hpp https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes#diff-338b355afc164aa2362ec09d31a08fbdab9511e3dd9cba7ccd72f60695916754
CMakeLists.txthttps://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes#diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20a
View file https://patch-diff.githubusercontent.com/Query-farm/httpserver/blob/bdfe7819b57592d0c0bb258d4823395162b96f75/CMakeLists.txt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/{{ revealButtonHref }}
https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes#diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20a
https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes#diff-1e7de1ae2d059d21e1dd75d5812d5a34b0222cef273b7c3a2af62eb747f9d20a
docs/DISCOVERY.mdhttps://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes#diff-e5ce7a400706263a38ec306bc982616275cd778a13e5bf0b1d41bf4bb8d1a37a
View file https://patch-diff.githubusercontent.com/Query-farm/httpserver/blob/bdfe7819b57592d0c0bb258d4823395162b96f75/docs/DISCOVERY.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/{{ revealButtonHref }}
src/discovery.cpphttps://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes#diff-0495e390238c18d6cb7f4f5795ef8ed489b00ca7f70cab78c5b9f55effa45f2d
View file https://patch-diff.githubusercontent.com/Query-farm/httpserver/blob/bdfe7819b57592d0c0bb258d4823395162b96f75/src/discovery.cpp
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/{{ revealButtonHref }}
Please reload this pagehttps://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes
Please reload this pagehttps://patch-diff.githubusercontent.com/Query-farm/httpserver/pull/12/changes
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.