theturtle32 / WebSocket-Node

A WebSocket Implementation for Node.JS (Draft -08 through the final RFC 6455)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to connect with auth info in url and special characters

chriscoindeskindices opened this issue · comments

My connection URL is something like:

wss://user:password_123!@domain.com/path

When I try to connect to this URL using plain WebSocket in the browser it has no issue, but with WebSocketClient I get a 401 response from the server. Somehow the auth information is not being sent.

You are right, this is an oversight!

This code should be passing the auth property as part of the requestOptions object.

https://nodejs.org/dist/latest-v20.x/docs/api/http.html#httprequesturl-options-callback