fix(tsconnect/wasm): Node.js compatibility — safesocket unique name, listen addr normalisation #13

Merged
codinget merged 3 commits from wasm-node-fixes into webnet 2026-06-15 00:17:31 +02:00
Showing only changes of commit 4618ee1496 - Show all commits
+5
View File
@@ -873,6 +873,11 @@ func (i *jsIPN) listen(network, addr string) js.Value {
if n == "tcp" {
n = "tcp4"
}
// netstack.ListenTCP requires a full host:port; normalise the
// standard net.Listen form ":port" that omits the host.
if strings.HasPrefix(addr, ":") {
addr = "0.0.0.0" + addr
}
ln, err := i.ns.ListenTCP(n, addr)
if err != nil {
return nil, err