Websocket connection closes

Hello,

i’m trying to make a websocket connection from the UI to the janus server and in the UI i can see that the websocket connection is getting closed and it falls back to http connection (for signalling). i have attached a screenshot of this.
i enabled debug logs for websocket in the janus server and i can see this error -
: INFO, tardis.janus.stdout, [libwebsockets][ERR] [2023/08/02 15:20:53:4160] E: Ran out of header data space

when can this happen? i’ve built the janus app using v0.12.0 tag and libwebsockets version 4.3.0
i’ve also tried this in incognito and cleared cookies, it didn’t help.

let me know if you need any more logs or configs.

# WebSockets stuff: whether they should be enabled, which ports they
# should use, and so on.
general: {
    json = "indented"               # Whether the JSON messages should be indented (default),
                                    # plain (no indentation) or compact (no indentation and no spaces)
    #pingpong_trigger = 30          # After how many seconds of idle, a PING should be sent
    #pingpong_timeout = 10          # After how many seconds of not getting a PONG, a timeout should be detected

    ws = {{ args["ws"] }}           # Whether to enable the WebSockets API
    ws_port = {{ args["ws_port"] }}                 # WebSockets server port
    #ws_interface = "eth0"          # Whether we should bind this server to a specific interface only
    #ws_ip = "192.168.0.1"          # Whether we should bind this server to a specific IP address only
    wss = false                     # Whether to enable secure WebSockets
    #wss_port = 8989                # WebSockets server secure port, if enabled
    #wss_interface = "eth0"         # Whether we should bind this server to a specific interface only
    #wss_ip = "192.168.0.1"         # Whether we should bind this server to a specific IP address only
    #ws_logging = "err,warn"        # libwebsockets debugging level as a comma separated list of things
                                    # to debug, supported values: err, warn, notice, info, debug, parser,
                                    # header, ext, client, latency, user, count (plus 'none' and 'all')
    #ws_acl = "127.,192.168.0."     # Only allow requests coming from this comma separated list of addresses
}

can you please help in debugging this further?

Sounds like a libwebsockets issue. Maybe your HTTP requests have too many HTTP headers, like cookies, or query string arguments?

Accept-Encoding:
gzip, deflate, br
Accept-Language:
en-GB,en-US;q=0.9,en;q=0.8
Cache-Control:
no-cache
Connection:
Upgrade
Host:
cloudport-trex.blue.ccp.sinclaircloud.net
Origin:
https://cloudport.blue.ccp.sinclaircloud.net
Pragma:
no-cache
Sec-Websocket-Extensions:
permessage-deflate; client_max_window_bits
Sec-Websocket-Key:
gq8LY8USnIeVrYZvuU2isw==
Sec-Websocket-Protocol:
janus-protocol
Sec-Websocket-Version:
13
Upgrade:
websocket
User-Agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36

that’s the request headers being sent. anything else i can check?
i’ve tried incognito and cleared cookies as well thinking it could be something to do with the cookies but that didn’t help. anything else i can check in the janus websocket logs?

“2023-08-03T17:22:24+05:30 Aug 03 11:52:24 use1-blue-cloudport-live-INGEST_DD-TND_E-udp2webrtc es_to_webrtc: INFO, tardis.janus.stdout, [libwebsockets][PARSER] [2023/08/03 11:52:23 :7782] P: issuing 1162 bytes to parser

does this mean the header is of 1162 bytes?

Here they say that the default for headers was 1024, but they changed it to 4096. Maybe it’s still 1024 to you for some reason. You can try adding this line

info.max_http_header_data = 4096;

to the transport, e.g., here, and do a new make install to see if that fixes it.

i’ve made it 16384 and still seeing the same issue.

Then I think you need to open an issue on the libwebsockets repo.

okay, thanks. will do that.
so, the websocket connection fails when this error comes, is it?