WebSocket connection is not working in IIS

Amjad Almaqbali 20 Reputation points
2024-12-12T05:32:56.0966667+00:00

Hi,

I have created a web site in IIS, trying to test websocket connection.

The files I have are: test_websocket.pdf

  • test.html
  • server_test.py
  • web.config

I have the following configurations:

  • I have enabled : httpPlatformHandler
  • In the server Manager the Websocket is installed.
  • In the configuration editor, the system.webServer/webSocket is enabled.

I keep getting the following errors:

2024-12-12T05:22:10.524Z: Page loaded

2024-12-12T05:22:10.525Z: Starting connection process...

2024-12-12T05:22:10.526Z: Attempting to connect to: wss://bot.dm-mn.com/ws

2024-12-12T05:22:10.527Z: WebSocket object created

2024-12-12T05:22:10.550Z: Connected!

2024-12-12T05:22:10.550Z: WebSocket opened

2024-12-12T05:22:10.551Z: Connection closed. Code: 1006, Reason: No reason provided

2024-12-12T05:22:10.551Z: Close event - wasClean: false

2024-12-12T05:22:15.556Z: Starting connection process...

2024-12-12T05:22:15.556Z: Attempting to connect to: wss://bot.dm-mn.com/ws

2024-12-12T05:22:15.557Z: WebSocket object created

2024-12-12T05:22:15.969Z: WebSocket error: Unknown error

2024-12-12T05:22:15.969Z: WebSocket error object: {"isTrusted":true}

2024-12-12T05:22:15.970Z: Connection closed. Code: 1006, Reason: No reason provided

2024-12-12T05:22:15.970Z: Close event - wasClean: false

I have attached the test files I'm using, kindly guide me on how to solve this.

Regards,

Amjad

Internet Information Services
{count} votes

Accepted answer
  1. Lex Li (Microsoft) 5,742 Reputation points Microsoft Employee
    2024-12-12T05:45:26.2633333+00:00

    Did you try to disable compression as documented in https://github.com/python-websockets/websockets/issues/1192?

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.