paullouisageneau / libdatachannel

C/C++ WebRTC network library featuring Data Channels, Media Transport, and WebSockets
https://libdatachannel.org/
Mozilla Public License 2.0
1.76k stars 357 forks source link

WebSocket basic auth. #198

Open Nemirtingas opened 4 years ago

Nemirtingas commented 4 years ago

Can you add the basic auth support to your websocket ? It adds a header like so: authorization: 'Basic TVlFUElDVVNFUjpNWUVQSUNQQVNTV09SRA==',

If you don't add it, I guess you would like to fix the url regex then because doing like so ws://user:password@ip:port/ makes your impl missbehave. URL: ws://user:password@ip:port/ID mHost = user:password@ip:port mHostname = user mService = password@ip:port

paullouisageneau commented 4 years ago

That would be a good feature to have. It's a bit more complex than just a header because you need two HTTP requests instead of one.

In the meantime, I'll fix the regex to handle the credentials.