添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
完美的红金鱼  ·  java - DB2 SQL-Error: ...·  1 年前    · 
活泼的伤痕  ·  How can attach a ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I got HTTP 200 in handshake instead of HTTP 101. I use this SignalR client library mandrewcito/signalrcore . My API is hosted on IIS over SSL (TLS 1.2).

self.awakeHub = HubConnectionBuilder()\
    .with_url(self.configuration.ServiceBaseAddress + "/hubs/awake", options=
        "verify_ssl": False,
        "skip_negotiation": False,
    .configure_logging(logging.DEBUG, socket_trace=True)\
    .with_automatic_reconnect({
        "type": "interval",
        "keep_alive_interval": 10,
        "intervals": [1, 3, 5, 6, 7, 87, 3]
    }).build()
self.awakeHub.on_open(lambda: print("connection opened and handshake received ready to send messages"))
self.awakeHub.on_close(lambda: print("connection closed"))
self.awakeHub.on_error(lambda data: print(f"An exception was thrown closed{data.error}"))
self.awakeHub.on("AwakeReceived_Group", lambda data: self.awakeReceived(data))
self.awakeHub.start()

HEADERS

Upgrade: websocket
Host: ***********
Origin: http://........
Sec-WebSocket-Key: rYqQacwytXMJ2roFL6AgwQ==
Sec-WebSocket-Version: 13
Connection: upgrade
2020-11-16 20:47:57,432 - websocket - DEBUG - -----------------------
2020-11-16 20:47:57,432 - websocket - DEBUG - --- response header ---
2020-11-16 20:47:57,451 - websocket - DEBUG - HTTP/1.1 200 OK
2020-11-16 20:47:57,452 - websocket - DEBUG - Content-Length: 0
2020-11-16 20:47:57,453 - websocket - DEBUG - Content-Type: application/octet-stream
2020-11-16 20:47:57,453 - websocket - DEBUG - Server: Microsoft-IIS/8.5
2020-11-16 20:47:57,454 - websocket - DEBUG - X-Powered-By: ASP.NET
2020-11-16 20:47:57,454 - websocket - DEBUG - Date: Mon, 16 Nov 2020 19:47:56 GMT
2020-11-16 20:47:57,455 - websocket - DEBUG - -----------------------

"Handshake status 200 OK" is when they use wrong transport type. "Handshake status 404 Not found" is when websockets communication is not allowed on server side.

I have to turn on websockets feature in IIS because this library support only websockets transport type.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.