websocket icon indicating copy to clipboard operation
websocket copied to clipboard

[BUG] Chat example does not work

Open jloic opened this issue 6 months ago • 1 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Current Behavior

Chat example does not work because the upgrader does not implement the CheckOrigin

fix for the demo: https://github.com/jloic/websocket/commit/bf7d582703e3a01ce2cb3345e050ba793db83ea3

Expected Behavior

No response

Steps To Reproduce

No response

Anything else?

No response

jloic avatar May 20 '25 12:05 jloic

The chat example works as is.

Because the home page is served from the same origin as the websocket endpoint, the default origin check logic allows the connection to go through.

Edit: OP suggests that the example disable origin checks. It's a bad idea to demonstration a disabled origin check in the examples because disabled origin checks are a security vulnerability in most application scenarios.

ghost avatar Jun 02 '25 15:06 ghost