engine.io-client icon indicating copy to clipboard operation
engine.io-client copied to clipboard

Adding an option to avoid the added trailing slash to the path

Open iifawzi opened this issue 3 years ago • 0 comments

Signed-off-by: iifawzi [email protected]

Hi, this PR is adding an option to avoid the added trailing slash to the path in the connection Resolving https://github.com/socketio/socket.io-client/issues/1550.

An example of a use case for this is the Microsoft bot framework stream URL: Reconnect to a conversation in Direct Line API 3.0

io(`wss://directline.botframework.com/v3/directline/conversations/convId/stream?t=tokenId`)

I needed to use the native WebSocket since the engine.io-client is always adding a trailing slash after stream which broke the URI and hence the connection.

Having this as an optional option would solve such use cases.

  • [ ] a bug fix
  • [x] a new feature
  • [ ] an update to the documentation
  • [ ] a code change that improves performance
  • [ ] other

Current behaviour

a trailing slash is always added to the path.

New behaviour

a trailing slash is still added to the path, but can be avoided by setting the trailingSlash option to false.

iifawzi avatar Oct 15 '22 20:10 iifawzi