Re: [whatwg/url] Addressing HTTP servers over Unix domain sockets (#577)

By the way, for a tool to monitor the data exchanged at a unix socket, on Linux, there is `sockdump.py`, from https://github.com/mechpen/sockdump, using an embedded "extended Berkeley Packet Filter" program.

And, to view the http server output from a unix socket on any browser, this single-line shell script, adapted from https://gist.github.com/Boldewyn/4311962, may be useful:
```sudo curl --unix-socket /run/caddy/serve.sock -H "host:" http://a | your-favorite-browser-here $(base64 -w0 | cat <(echo -n 'data:text/html;charset=UTF-8;base64,') -)```

The server domain there, "a", is an arbitrary random character.  It is ignored by the server, but `curl` will fail without it.  Additional header options in `curl` may or may not be needed by the server.

Any local hyperlinks in the page, back to the unix socket, will not work, of course, but otherwise, the page will be rendered properly.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/577#issuecomment-1189496202
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/url/issues/577/1189496202@github.com>

Received on Tuesday, 19 July 2022 19:59:44 UTC