locked
Windows Auth + Chrome = Long Polling? RRS feed

  • Question

  • User2015412452 posted

    Hello Everyone. Just trying to figure out where the problem is with Chrome & Signal R when using Windows Authentication. I have a basic site setup thats using windows authentication. From what i'm seeing in the console of chrome its reverting back to long polling rather than using web sockets:

    [11:43:10 GMT-0600 (Central Standard Time)] SignalR: Connecting to websocket endpoint 'ws://localhost:4952/signalr/connect?transport=webSockets&connectionToken=x%2F4eBvKDwAVaJqWWaPzQvSsPxNBhoJx7jPf058rmnROgIhlJAa1Rc5L24QqS7kSOsfP4OdmG2qQa0qEjV%2BaHTS3NGvZ1sS67EYWSJZhon48gD9BgkQt6tQX9HUz%2FjV4m&connectionData=%5B%7B%22name%22%3A%22perfhub%22%7D%5D&tid=5'. jquery.signalR-2.0.1.min.js:8
    WebSocket connection to 'ws://localhost:4952/signalr/connect?transport=webSockets&connectionToken=x%2F4eBvKDwAVaJqWWaPzQvSsPxNBhoJx7jPf058rmnROgIhlJAa1Rc5L24QqS7kSOsfP4OdmG2qQa0qEjV%2BaHTS3NGvZ1sS67EYWSJZhon48gD9BgkQt6tQX9HUz%2FjV4m&connectionData=%5B%7B%22name%22%3A%22perfhub%22%7D%5D&tid=5' failed: Unexpected response code: 401 jquery.signalR-2.0.1.min.js:8
    [11:43:10 GMT-0600 (Central Standard Time)] SignalR: Closing the Websocket. jquery.signalR-2.0.1.min.js:8
    [11:43:10 GMT-0600 (Central Standard Time)] SignalR: Attempting to connect to SSE endpoint 'http://localhost:4952/signalr/connect?transport=serverSentEvents&connection…tQX9HUz%2FjV4m&connectionData=%5B%7B%22name%22%3A%22perfhub%22%7D%5D&tid=5'. jquery.signalR-2.0.1.min.js:8
    [11:43:10 GMT-0600 (Central Standard Time)] SignalR: EventSource connected. jquery.signalR-2.0.1.min.js:8
    [11:43:10 GMT-0600 (Central Standard Time)] SignalR: Now monitoring keep alive with a warning timeout of 13333.333333333332 and a connection lost timeout of 20000.

    You will see chrome is geting a http 401 (unauthorized) error when trying to setup the websocket connection.

    I searched a little bit on the error and which lead me here: https://github.com/SignalR/SignalR/issues/1934

    Damain said it was apparently a bug with chrome: https://code.google.com/p/chromium/issues/detail?id=123862

    I thought it would be a good excersize to investigate what was going on as a learning experience. If you read the chrome bug you will see the bug is apparently it not sending the authenticate header correctly in basic/digest authentication. 

    So i decided to fire up fiddler. What is REALLY wierd is the web socket connection works with chrome when fiddler is the proxy but doesn't when i shut fiddler down.

    I decided to fire up IE11 since they said it worked with IE and it in fact does :

       HTML1300: Navigation occurred.
       File: localhost:4952
       [11:53:19 GMT-0600 (Central Standard Time)] SignalR: Client subscribed to hub 'perfhub'.
       [11:53:19 GMT-0600 (Central Standard Time)] SignalR: Negotiating with '/signalr/negotiate?connectionData=%5B%7B%22name%22%3A%22perfhub%22%7D%5D&clientProtocol=1.3'.
       [11:53:19 GMT-0600 (Central Standard Time)] SignalR: Connecting to websocket endpoint 'ws://localhost:4952/signalr/connect?transport=webSockets&connectionToken=8fyp8Y0rHeOOdg1qVs7N66l0OUcXMes5PrMDqFjnWRFAtNeJX%2BA3eJwu41ntJcLYxBsPqxtuR9CcdTpLdFX7Qrr0Q0%2Bhy0cZiGkKidD9LZrU5gUZjPABJJ6pkg%2B2ixvR&connectionData=%5B%7B%22name%22%3A%22perfhub%22%7D%5D&tid=2'.
       [11:53:19 GMT-0600 (Central Standard Time)] SignalR: Websocket opened.
       [11:53:19 GMT-0600 (Central Standard Time)] SignalR: Now monitoring keep alive with a warning timeout of 13333.333333333332 and a connection lost timeout of 20000.
    

    But whats confusing me is i never see a http authorization header sent with ie11 either:

    Key	Value
    Request	GET http://localhost:4952/signalr/negotiate?connectionData=%5B%7B%22name%22%3A%22perfhub%22%7D%5D&clientProtocol=1.3&_=1388166799199 HTTP/1.1
    Accept	text/plain, */*; q=0.01
    Content-Type	application/json; charset=UTF-8
    X-Requested-With	XMLHttpRequest
    Referer	http://localhost:4952/
    Accept-Language	en-US,en;q=0.5
    Accept-Encoding	gzip, deflate
    User-Agent	Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko
    Proxy-Connection	Keep-Alive
    DNT	1
    Host	localhost:4952

    What i'm using:

    Chrome 31

    VS 2013

    IIS Express 8

    Windows 8.1

    SignalR 2


    Ncage

    Friday, December 27, 2013 1:03 PM

All replies

  • User1255648157 posted

    Hey- I ran into this issue. Have you been able to figure out a workaround? All my research pointed to a chrome bug :\

    Friday, April 14, 2017 9:45 AM
  • User-1268245961 posted

    Seeing the same behaviour with firefox

    Friday, July 14, 2017 4:46 PM