Skip to content

Commit

Permalink
Fix #111, Add missing key field Sec-WebSocket-Protocol.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc committed Aug 25, 2020
1 parent 59969a1 commit c964133
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/src/transports/websocket_dart_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,15 @@ class WebSocketImpl {

var request = await client.getUrl(Uri.parse(
(scheme == 'wss' ? 'https' : 'http') +
'://$host:$port/ws')); // form the correct url here
'://$host:$port')); // form the correct url here

request.headers.add('Connection', 'Upgrade');
request.headers.add('Upgrade', 'websocket');
request.headers.add(
'Sec-WebSocket-Version', '13'); // insert the correct version here
request.headers.add('Sec-WebSocket-Key', key.toLowerCase());
request.headers.add('Sec-WebSocket-Protocol', 'sip');

//request.headers.add('Origin', 'http://localhost:5060');
//request.headers.add('Sec-WebSocket-Protocol', 'sip');
webSocketSettings.extraHeaders.forEach((key, value) {
request.headers.add(key, value);
});
Expand Down

0 comments on commit c964133

Please sign in to comment.