sipgo icon indicating copy to clipboard operation
sipgo copied to clipboard

[bug] ws connect to opensips failed.

Open QuincyGao opened this issue 1 year ago • 1 comments

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)

QuincyGao avatar Jan 16 '25 09:01 QuincyGao

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

emiago avatar Jan 17 '25 21:01 emiago