-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
Milestone
Description
Subprotocol support specified by URI query:
var ub = new UriBuilder(server);
ub.Query = "subprotocol=" + AcceptedProtocol;
throw the following exception:
fail: [out of order message from the browser]: http://127.0.0.1:58688/dotnet.js 9661 WebSocket connection to 'ws://corefx-net-http11.azurewebsites.net/WebSocket/EchoWebSocket.ashx?subprotocol=CustomProtocol' failed: Error during WebSocket handshake: Unexpected response code: 400
fail: [FAIL] System.Net.WebSockets.Client.Tests.ConnectTest.ConnectAsync_PassNoSubProtocol_ServerRequires_ThrowsWebSocketException(server: ws://corefx-net-http11.azurewebsites.net/WebSocket/EchoWebSocket.ashx)
info: Assert.True() Failure
info: Expected: True
info: Actual: False
info: at System.Net.WebSockets.Client.Tests.ConnectTest.ConnectAsync_PassNoSubProtocol_ServerRequires_ThrowsWebSocketException(Uri server)
subprotocols are supported via websockets options and specifying the subprotocol via the AddSubProtocol method.
cws.Options.AddSubProtocol(AcceptedProtocol);