Open guest271314 opened 2 weeks ago
Can you try making a debug from latest master? The backtrace will be more meaningfull. You can do that with make debug
I don't see much difference in the output in terminal with a debug build
tjs run txikijs-ws-server.js
Listening on family: 2, ip: 0.0.0.0, port: 8080
{ family: 2, ip: '127.0.0.1', port: 8080 } { family: 2, ip: '127.0.0.1', port: 59444 }
{ response: {} }
[connection close frame]
Close frame null
{ response: null }
{ '0': 136, '1': 0 }
writer closed
Error: invalid argument
at pull (�W$:0:0)
at apply (native)
at call (native)
at x (�W$:0:0)
at C (�W$:0:0)
at <anonymous> (�W$:0:0)
at <anonymous> (�W$:0:0)
at Ht (�W$:0:0)
at [[[PullSteps]]] (�W$:0:0)
at Rr (�W$:0:0)
Trace:
at <anonymous> (txikijs-ws-server.js:86:3)
I'm writing a JavaScript runtime agnostic HTTP and WebSocket server.
txiki.js
Connection
throwswhen sending WebSocket close frame to the client.
I don't know where or why the error is thrown.
Essentially the same code does not throw when Direct Sockets
TCPServerSocker
is used as a WebSocket server in an Isolated Web App in Chromium and Chrome browsers.Steps to reproduce:
Download attached files to the same directory, run the following
For client run
or run the same code in Chromium or Chrome browser which supports WebSocketStream.
Relevant code in txikijs-ws-server.js L36-52
and the end of
writable
side ofConnecion
piped to aWritableStream()
where the error is read L73-88.Tested with
deno
version 1.43.3 (release, x86_64-unknown-linux-gnu) and Chromium Version 126.0.6477.0 (Developer Build) (64-bit).txiki.js version: v23.12.0.
Potentially related: https://github.com/saghul/txiki.js/issues/450.