socketio / socketio/socket.io

WebTransport ignores query parameters in URL

Open Beginner friendly
#5,496 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
TypeScript
Stars
63.2k
Forks
10.3k
Avg merge
11d 20h
Merged PRs (30d)
2

Description

Describe the bug
The final WebTransport URL doesn't include the query parameters from the original URL.

To Reproduce

engine.io-client 6.6.4

Client

// Connects to: https://localhost:1234/engine.io/?x=y&EIO=4&transport=polling&t=zsyh7czl 
eio("https://localhost:1234/?x=y", {transports: ["polling"]});

// Connects to: wss://localhost:1234/engine.io/?x=y&EIO=4&transport=websocket
eio("https://localhost:1234/?x=y", {transports: ["websocket"]});

// Connects to: https://localhost:1234/engine.io/
eio("https://localhost:1234/?x=y", {transports: ["webtransport"]});

Expected behavior
The WebTransport transport should preserve the query parameters in the same way other transports do.

Additional context

WebTransport currently uses createUri to construct the URL:

https://github.com/socketio/socket.io/blob/439a8f669c6788b512dd76011c4476830d67515b/packages/engine.io-client/lib/transports/webtransport.ts#L31-L34

It doesn't include the original query parameters:

https://github.com/socketio/socket.io/blob/439a8f669c6788b512dd76011c4476830d67515b/packages/engine.io-client/lib/transport.ts#L176-L185

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading packages/engine.io-client/lib/transports/webtransport.ts at the linked URL construction and compare it with packages/engine.io-client/lib/transport.ts at the linked query-handling code. Reproduce the three client examples, then verify that the WebTransport URL preserves the original query parameters like the polling and websocket URLs.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.