-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set Cross domain origin? #194
Comments
Hi @gunsluo You'd verify the Origin header yourself before accepting the WebSocket. This is how the default works: https://github.com/nhooyr/websocket/blob/c62c0dcc9318d1ad612613d433ec90d7c34378dc/accept.go#L168 You'd want the same except you'd verify against your domain in https://github.com/nhooyr/websocket/blob/c62c0dcc9318d1ad612613d433ec90d7c34378dc/accept.go#L175 instead of |
I'll add an example for this. |
@nhooyr thanks. sorry for reply later. in fact, we use the same method. I expect WebSocket to provide a configurable item. |
I agree, let's add it as I think it is a common use case. How about |
Please review #198 |
Hi everyone! It seems the client I'm not sure if that is a problem or a standard but if the origin is set like Just thought that might be helpful for someone who surfs the issues related to accept origins or stuff like that. |
still having issues with this... it does not work with flutter client
i have
and I connect
this I assume is a standard development test case. so, what should my thx |
@biskit |
in AcceptOptions struct, I found the
InsecureSkipVerify
field and set it equal to true. but all clients can connect to the WebSocket server, it includes illegal clients. in gorilla have CheckOrigin. but there is no the same method. (AcceptOrigins and add AcceptInsecureOrigin is removed in the current version).@nhooyr How to set origin like gorilla's
CheckOrigin
? Looking forward to your reply, appreciate it. Thanks.The text was updated successfully, but these errors were encountered: