René's URL Explorer Experiment


Title: Add runtime-agnostic WebSocket routing to `@bquery/bquery/server` by Copilot · Pull Request #88 · bQuery/bQuery · GitHub

Open Graph Title: Add runtime-agnostic WebSocket routing to `@bquery/bquery/server` by Copilot · Pull Request #88 · bQuery/bQuery

X Title: Add runtime-agnostic WebSocket routing to `@bquery/bquery/server` by Copilot · Pull Request #88 · bQuery/bQuery

Description: The server backend stopped at HTTP middleware/routing and did not provide a first-class path for WebSocket upgrades. This change extends @bquery/bquery/server with explicit WebSocket route registration and a runtime-agnostic session layer so upgrade handling can plug into Bun/Deno/Node-style hosts without changing the existing HTTP flow. Server API Added app.ws(path, handler, middlewares?) for WebSocket routes alongside existing HTTP method helpers Added app.handleWebSocket(request) to resolve upgrade requests into either: null when the request is not a WebSocket handshake or no route matches a Response when middleware/error handling short-circuits a ServerWebSocketSession when the upgrade should be accepted Added isWebSocketRequest() and isServerWebSocketSession() helpers for adapter/runtime integration Session model Introduced runtime-agnostic server WebSocket types: ServerWebSocketSession ServerWebSocketPeer ServerWebSocketConnection ServerWebSocketHandlerSet ServerWebSocketRouteHandler Session callbacks cover onOpen, onMessage, onClose, and onError Added socket.sendJson() for structured outbound messages Normalized requested subprotocols and preserved route params, query, and middleware-populated state inside the session context Behavior WebSocket routes reuse the existing middleware pipeline instead of introducing a parallel stack Middleware can short-circuit upgrades with a normal Response Incoming text frames default to JSON parsing with raw-string fallback for non-JSON payloads Existing HTTP handle() behavior remains unchanged Docs and public surface Updated server guide and top-level project summaries to document the new backend WebSocket flow Synced server exports and full-bundle metadata with the new public API import { createServer, isServerWebSocketSession, isWebSocketRequest, } from '@bquery/bquery/server'; const app = createServer(); app.ws('/chat/:room', (ctx) => ({ protocols: ['chat'], onOpen(socket) { socket.sendJson({ type: 'ready', room: ctx.params.room }); }, onMessage(message, socket) { socket.sendJson({ type: 'echo', message }); }, })); export async function handler(request: Request) { if (!isWebSocketRequest(request)) { return app.handle(request); } const result = await app.handleWebSocket(request); if (result instanceof Response || result === null) { return result ?? new Response('Not Found', { status: 404 }); } if (isServerWebSocketSession(result)) { const { socket, response } = Deno.upgradeWebSocket(request, { protocol: result.protocols[0], }); socket.onopen = () => void result.open(socket); socket.onmessage = (event) => void result.message(socket, event); socket.onclose = (event) => void result.close(socket, event); socket.onerror = (event) => void result.error(socket, event); return response; } return new Response('Upgrade failed', { status: 500 }); }

Open Graph Description: The server backend stopped at HTTP middleware/routing and did not provide a first-class path for WebSocket upgrades. This change extends @bquery/bquery/server with explicit WebSocket route registra...

X Description: The server backend stopped at HTTP middleware/routing and did not provide a first-class path for WebSocket upgrades. This change extends @bquery/bquery/server with explicit WebSocket route registra...

Opengraph URL: https://github.com/bQuery/bQuery/pull/88

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:58c6b530-571b-f5fb-7a3d-d402745c360d
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB5A6:9C379:BAD523:BF1325:6A4DB944
html-safe-noncedf08380930ef96f4c8aef4be9f992eb5d4170a4750d1a3069fb1ea2e090b7c85
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNUE2OjlDMzc5OkJBRDUyMzpCRjEzMjU6NkE0REI5NDQiLCJ2aXNpdG9yX2lkIjoiNDM0NDkyNjk2Mjk2MDkzOTMzMiIsInJlZ2lvbl9lZGdlIjoic2VhIiwicmVnaW9uX3JlbmRlciI6InNlYSJ9
visitor-hmac5d8cad2f3210d61d0645d7acd828ded9697c66f36f81a7248fe212b5b3d647d4
hovercard-subject-tagpull_request:3603065417
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/bQuery/bQuery/pull/88/files
twitter:imagehttps://avatars.githubusercontent.com/in/1143301?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/in/1143301?s=400&v=4
og:image:altThe server backend stopped at HTTP middleware/routing and did not provide a first-class path for WebSocket upgrades. This change extends @bquery/bquery/server with explicit WebSocket route registra...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/bQuery/bQuery git https://github.com/bQuery/bQuery.git
octolytics-dimension-user_id256381806
octolytics-dimension-user_loginbQuery
octolytics-dimension-repository_id1139284244
octolytics-dimension-repository_nwobQuery/bQuery
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1139284244
octolytics-dimension-repository_network_root_nwobQuery/bQuery
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
release32f7b614aca06e6bbd89842b1370df1328264f68
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/bQuery/bQuery/pull/88/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FbQuery%2FbQuery%2Fpull%2F88%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
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://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FbQuery%2FbQuery%2Fpull%2F88%2Ffiles
Sign up https://github.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=bQuery%2FbQuery
Reloadhttps://github.com/bQuery/bQuery/pull/88/files
Reloadhttps://github.com/bQuery/bQuery/pull/88/files
Reloadhttps://github.com/bQuery/bQuery/pull/88/files
Please reload this pagehttps://github.com/bQuery/bQuery/pull/88/files
bQuery https://github.com/bQuery
bQueryhttps://github.com/bQuery/bQuery
Please reload this pagehttps://github.com/bQuery/bQuery/pull/88/files
Notifications https://github.com/login?return_to=%2FbQuery%2FbQuery
Fork 0 https://github.com/login?return_to=%2FbQuery%2FbQuery
Star 1 https://github.com/login?return_to=%2FbQuery%2FbQuery
Code https://github.com/bQuery/bQuery
Issues 0 https://github.com/bQuery/bQuery/issues
Pull requests 0 https://github.com/bQuery/bQuery/pulls
Actions https://github.com/bQuery/bQuery/actions
Security and quality 0 https://github.com/bQuery/bQuery/security
Insights https://github.com/bQuery/bQuery/pulse
Code https://github.com/bQuery/bQuery
Issues https://github.com/bQuery/bQuery/issues
Pull requests https://github.com/bQuery/bQuery/pulls
Actions https://github.com/bQuery/bQuery/actions
Security and quality https://github.com/bQuery/bQuery/security
Insights https://github.com/bQuery/bQuery/pulse
Sign up for GitHub https://github.com/signup?return_to=%2FbQuery%2FbQuery%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FbQuery%2FbQuery%2Fissues%2Fnew%2Fchoose
JosunLPhttps://github.com/JosunLP
developmenthttps://github.com/bQuery/bQuery/tree/development
copilot/expand-backend-websocket-supporthttps://github.com/bQuery/bQuery/tree/copilot/expand-backend-websocket-support
Conversation 7 https://github.com/bQuery/bQuery/pull/88
Commits 4 https://github.com/bQuery/bQuery/pull/88/commits
Checks 17 https://github.com/bQuery/bQuery/pull/88/checks
Files changed https://github.com/bQuery/bQuery/pull/88/files
Please reload this pagehttps://github.com/bQuery/bQuery/pull/88/files
Add runtime-agnostic WebSocket routing to @bquery/bquery/server https://github.com/bQuery/bQuery/pull/88/files#top
Show all changes 4 commits https://github.com/bQuery/bQuery/pull/88/files
24f7c58 feat(server): add websocket session routing Copilot Apr 29, 2026 https://github.com/bQuery/bQuery/pull/88/commits/24f7c58cac5569e158162d87354cb01c85b09230
2c33fa5 fix(server): polish websocket session helpers Copilot Apr 29, 2026 https://github.com/bQuery/bQuery/pull/88/commits/2c33fa5a9225dcf8f8c9631cea9ff8767078795b
f6fc1da fix(server): address websocket review feedback Copilot Apr 29, 2026 https://github.com/bQuery/bQuery/pull/88/commits/f6fc1dabf88457799c0927e1c3534f4fde95c01a
9d954d1 chore(server): finalize review cleanup Copilot Apr 29, 2026 https://github.com/bQuery/bQuery/pull/88/commits/9d954d1ecb75f0521b827b1a53427c3550e29f93
Clear filters https://github.com/bQuery/bQuery/pull/88/files
Please reload this pagehttps://github.com/bQuery/bQuery/pull/88/files
Please reload this pagehttps://github.com/bQuery/bQuery/pull/88/files
.clinerules https://github.com/bQuery/bQuery/pull/88/files#diff-327ad2697caff5db343d54dee7542c51476180464fb85667c35e69816f8bd33d
.cursorrules https://github.com/bQuery/bQuery/pull/88/files#diff-315161dd3154081cb28d119355d3dd6de62ddc800ac1a12f8eb903e59047a018
AGENT.md https://github.com/bQuery/bQuery/pull/88/files#diff-c1e87407ce72f38b645f627c7fbda6e6999170c840cded6ce82c1bd2c10923e8
CHANGELOG.md https://github.com/bQuery/bQuery/pull/88/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
README.md https://github.com/bQuery/bQuery/pull/88/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
server.md https://github.com/bQuery/bQuery/pull/88/files#diff-243ae54884e2f05bcd55e5576bca13708a9120971f955ea579b3a568658da476
llms.txt https://github.com/bQuery/bQuery/pull/88/files#diff-f43a9e2f7da89777ca234fc2f236252b27a44652586c9514b243e81bf1b19114
full.ts https://github.com/bQuery/bQuery/pull/88/files#diff-3061502541780be549a3418b68cb60d2fbe8fc17f84f6ec533ce6bd0ab4eb95b
create-server.ts https://github.com/bQuery/bQuery/pull/88/files#diff-35b28cf33078fa1982a625ab671b36fce0e7b8de02b25b5c90defac733f9a170
index.ts https://github.com/bQuery/bQuery/pull/88/files#diff-e4e7a68d82cdfba4e7dab9a32a8f55f3806ffa0cf33f1b8ab64b42941cf68888
types.ts https://github.com/bQuery/bQuery/pull/88/files#diff-9a3a0a5fdd0766b53ba8436a42cd88d004c2dadf2853adbe4ca061f4b2215a40
server.test.ts https://github.com/bQuery/bQuery/pull/88/files#diff-28ef84c225a6c2db1bb2728a10b5af1c48addd809355d20fb44f93212c41f16d
.clineruleshttps://github.com/bQuery/bQuery/pull/88/files#diff-327ad2697caff5db343d54dee7542c51476180464fb85667c35e69816f8bd33d
View file https://github.com/bQuery/bQuery/blob/9d954d1ecb75f0521b827b1a53427c3550e29f93/.clinerules
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/88/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/88/files#diff-327ad2697caff5db343d54dee7542c51476180464fb85667c35e69816f8bd33d
https://github.com/bQuery/bQuery/pull/88/files#diff-327ad2697caff5db343d54dee7542c51476180464fb85667c35e69816f8bd33d
.cursorruleshttps://github.com/bQuery/bQuery/pull/88/files#diff-315161dd3154081cb28d119355d3dd6de62ddc800ac1a12f8eb903e59047a018
View file https://github.com/bQuery/bQuery/blob/9d954d1ecb75f0521b827b1a53427c3550e29f93/.cursorrules
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/88/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/88/files#diff-315161dd3154081cb28d119355d3dd6de62ddc800ac1a12f8eb903e59047a018
https://github.com/bQuery/bQuery/pull/88/files#diff-315161dd3154081cb28d119355d3dd6de62ddc800ac1a12f8eb903e59047a018
AGENT.mdhttps://github.com/bQuery/bQuery/pull/88/files#diff-c1e87407ce72f38b645f627c7fbda6e6999170c840cded6ce82c1bd2c10923e8
View file https://github.com/bQuery/bQuery/blob/9d954d1ecb75f0521b827b1a53427c3550e29f93/AGENT.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/88/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/88/files#diff-c1e87407ce72f38b645f627c7fbda6e6999170c840cded6ce82c1bd2c10923e8
https://github.com/bQuery/bQuery/pull/88/files#diff-c1e87407ce72f38b645f627c7fbda6e6999170c840cded6ce82c1bd2c10923e8
https://github.com/bQuery/bQuery/pull/88/files#diff-c1e87407ce72f38b645f627c7fbda6e6999170c840cded6ce82c1bd2c10923e8
https://github.com/bQuery/bQuery/pull/88/files#diff-c1e87407ce72f38b645f627c7fbda6e6999170c840cded6ce82c1bd2c10923e8
CHANGELOG.mdhttps://github.com/bQuery/bQuery/pull/88/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
View file https://github.com/bQuery/bQuery/blob/9d954d1ecb75f0521b827b1a53427c3550e29f93/CHANGELOG.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/88/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/88/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
https://github.com/bQuery/bQuery/pull/88/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
README.mdhttps://github.com/bQuery/bQuery/pull/88/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
View file https://github.com/bQuery/bQuery/blob/9d954d1ecb75f0521b827b1a53427c3550e29f93/README.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/88/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/88/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/bQuery/bQuery/pull/88/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/bQuery/bQuery/pull/88/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/bQuery/bQuery/pull/88/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
docs/guide/server.mdhttps://github.com/bQuery/bQuery/pull/88/files#diff-243ae54884e2f05bcd55e5576bca13708a9120971f955ea579b3a568658da476
View file https://github.com/bQuery/bQuery/blob/9d954d1ecb75f0521b827b1a53427c3550e29f93/docs/guide/server.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/88/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/88/files#diff-243ae54884e2f05bcd55e5576bca13708a9120971f955ea579b3a568658da476
https://github.com/bQuery/bQuery/pull/88/files#diff-243ae54884e2f05bcd55e5576bca13708a9120971f955ea579b3a568658da476
https://github.com/bQuery/bQuery/pull/88/files#diff-243ae54884e2f05bcd55e5576bca13708a9120971f955ea579b3a568658da476
https://github.com/bQuery/bQuery/pull/88/files#diff-243ae54884e2f05bcd55e5576bca13708a9120971f955ea579b3a568658da476
https://github.com/bQuery/bQuery/pull/88/files#diff-243ae54884e2f05bcd55e5576bca13708a9120971f955ea579b3a568658da476
llms.txthttps://github.com/bQuery/bQuery/pull/88/files#diff-f43a9e2f7da89777ca234fc2f236252b27a44652586c9514b243e81bf1b19114
View file https://github.com/bQuery/bQuery/blob/9d954d1ecb75f0521b827b1a53427c3550e29f93/llms.txt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/88/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/88/files#diff-f43a9e2f7da89777ca234fc2f236252b27a44652586c9514b243e81bf1b19114
https://github.com/bQuery/bQuery/pull/88/files#diff-f43a9e2f7da89777ca234fc2f236252b27a44652586c9514b243e81bf1b19114
src/full.tshttps://github.com/bQuery/bQuery/pull/88/files#diff-3061502541780be549a3418b68cb60d2fbe8fc17f84f6ec533ce6bd0ab4eb95b
View file https://github.com/bQuery/bQuery/blob/9d954d1ecb75f0521b827b1a53427c3550e29f93/src/full.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/88/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/88/files#diff-3061502541780be549a3418b68cb60d2fbe8fc17f84f6ec533ce6bd0ab4eb95b
https://github.com/bQuery/bQuery/pull/88/files#diff-3061502541780be549a3418b68cb60d2fbe8fc17f84f6ec533ce6bd0ab4eb95b
Please reload this pagehttps://github.com/bQuery/bQuery/pull/88/files
Please reload this pagehttps://github.com/bQuery/bQuery/pull/88/files
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.