Websocket with .Net core application in SignalR + Kestrel

Issue #106 closed
Antonio Gomes Rodrigues created an issue

Hi,

I have something strange that I don't success to find a solution

I have try the plugin with echo.websocket.org without problem

But when I try our application, I have this error

2019-02-22 16:48:59,861 DEBUG e.l.w.WebSocketClient: Creating connection with tdc-lifemap-platform.svc.interne-groupe-seloger.com:80 2019-02-22 16:48:59,866 DEBUG e.l.w.WebSocketClient: >> GET /hub/pushpin?id=mpC8qj0LR2E_3VfayawDzw HTTP/1.1 2019-02-22 16:48:59,866 DEBUG e.l.w.WebSocketClient: >> Host: *:80 2019-02-22 16:48:59,866 DEBUG e.l.w.WebSocketClient: >> Origin: http://* 2019-02-22 16:48:59,866 DEBUG e.l.w.WebSocketClient: >> Cache-Control: no-cache 2019-02-22 16:48:59,866 DEBUG e.l.w.WebSocketClient: >> Accept: text/html,application/xhtml+xm…ml;q=0.9,image/webp,/;q=0.8 2019-02-22 16:48:59,866 DEBUG e.l.w.WebSocketClient: >> User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36 2019-02-22 16:48:59,866 DEBUG e.l.w.WebSocketClient: >> Accept-Encoding: gzip, deflate 2019-02-22 16:48:59,867 DEBUG e.l.w.WebSocketClient: >> Accept-Language: fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7 2019-02-22 16:48:59,867 DEBUG e.l.w.WebSocketClient: >> Pragma: no-cache 2019-02-22 16:48:59,867 DEBUG e.l.w.WebSocketClient: >> Upgrade: websocket 2019-02-22 16:48:59,867 DEBUG e.l.w.WebSocketClient: >> Connection: Upgrade 2019-02-22 16:48:59,867 DEBUG e.l.w.WebSocketClient: >> Sec-WebSocket-Key: /t7DlRHshIYIh4zFFLnvzg== 2019-02-22 16:48:59,867 DEBUG e.l.w.WebSocketClient: >> Sec-WebSocket-Version: 13 2019-02-22 16:48:59,867 DEBUG e.l.w.WebSocketClient: >> 2019-02-22 16:48:59,870 DEBUG e.l.w.WebSocketClient: << HTTP/1.1 503 Service Unavailable 2019-02-22 16:48:59,870 DEBUG e.l.j.w.OpenWebSocketSampler: Http upgrade error in sampler 'WebSocket Open Connection'. eu.luminis.websocket.HttpUpgradeException: Http Upgrade failed with status code 503 at eu.luminis.websocket.WebSocketClient.checkHttpStatus(WebSocketClient.java:510) ~[jmeter-websocket-samplers-1.2.1.jar:?] at eu.luminis.websocket.WebSocketClient.checkServerResponse(WebSocketClient.java:460) ~[jmeter-websocket-samplers-1.2.1.jar:?] at eu.luminis.websocket.WebSocketClient.connect(WebSocketClient.java:186) ~[jmeter-websocket-samplers-1.2.1.jar:?] at eu.luminis.websocket.WebSocketClient.connect(WebSocketClient.java:104) ~[jmeter-websocket-samplers-1.2.1.jar:?] at eu.luminis.jmeter.wssampler.WebsocketSampler.sample(WebsocketSampler.java:159) [jmeter-websocket-samplers-1.2.1.jar:?] at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622) [ApacheJMeter_core.jar:r1853323] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546) [ApacheJMeter_core.jar:r1853323] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486) [ApacheJMeter_core.jar:r1853323] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253) [ApacheJMeter_core.jar:r1853323] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]

The application work fine with Chrome or Firefox

I have check all the header and I have the same with JMeter

Is anybody have successfully tested an .Net core application in SignalR + Kestrel? Can you help me?

Thanks Antonio

Comments (2)

  1. Peter Doornbosch repo owner

    Hi Antonio,

    Did you edit the logs show above? The Host and Origin header show a "*" as hostname, this should not be possible.

    Your server is sending a HTTP 503 status code, see https://httpstatuses.com/503. You should check the server logs to find out why it sends a 503.

    If you can't find it, the best advice i can give is to capture a session with wireshark while your browser is creating the websocket connection. May be that capture reveals an additional header that is required by your server.

    Hth. Regards Peter

  2. Log in to comment