Problem
The /discover endpoint uses raw TCP to fetch Chrome's /json/list, but:
- Chrome DevTools HTTP server ignores HTTP/1.0 requests (returns 0 bytes)
- With HTTP/1.1 +
Connection: close, the stream.read() loop blocks waiting for more data because Chrome doesn't close the connection promptly
net.Address.resolveIp() fails for hostname localhost — need parseIp4("127.0.0.1", port)
Fix Options
- Use HTTP/1.1 with Content-Length-aware read loop (parse headers, read exact body length)
- Add socket read timeout via
setsockopt(SO_RCVTIMEO) on the raw fd
- Consider using
std.http.Client from Zig 0.15.1 instead of raw TCP
Files
src/server/router.zig (handleDiscover)
src/cdp/websocket.zig (same resolveIp issue in parseWsUrl — should use parseIp4 for localhost)
Problem
The
/discoverendpoint uses raw TCP to fetch Chrome's/json/list, but:Connection: close, thestream.read()loop blocks waiting for more data because Chrome doesn't close the connection promptlynet.Address.resolveIp()fails for hostnamelocalhost— needparseIp4("127.0.0.1", port)Fix Options
setsockopt(SO_RCVTIMEO)on the raw fdstd.http.Clientfrom Zig 0.15.1 instead of raw TCPFiles
src/server/router.zig(handleDiscover)src/cdp/websocket.zig(sameresolveIpissue inparseWsUrl— should useparseIp4forlocalhost)