Skip to content
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

[bug] ws connect to opensips failed. #175

Open
QuincyGao opened this issue Jan 16, 2025 · 1 comment
Open

[bug] ws connect to opensips failed. #175

QuincyGao opened this issue Jan 16, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@QuincyGao
Copy link

Hi, I have a test with example/register via ws, opensips failed log:

proto_ws:ws_parse_req_handshake: Origin header not present!
Jan 16 16:47:06 [115] ERROR:proto_ws:ws_read_req: cannot complete WebSocket handshake

register log:

ERR TransactionRequest error="transport<WS> dial err=unexpected HTTP response status: 400"

the header should add Origin param like this:
header := http.Header{}
header.Add("Origin", "http://172.16.4.113:8443")
conn, _, err := dialer.Dial(url.String(), header)

@emiago
Copy link
Owner

emiago commented Jan 17, 2025

Thanks for reporting.
Seems like this is not currently easy to fix unless header are fixed.

@emiago emiago added the enhancement New feature or request label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants