I'm running lighttpd and openssh on an old box. Could it be configured to have lighttpd handle web traffic through www.example.com:80, but have ssh traffic through ssh.example.com:80?

Due to irrelevant circumstances, I find myself at times stuck behind a firewall that only allows traffic through port 80. Naturally, this poses a problem when connecting to sites using HTTPS. I want to set up a ssh tunnel on this box that's already serving content.

To keep the question general and useful, I'll phrase my question it similarly to the title: is it possible to set up ssh to listen on a specific port on a specific subdomain?

1 Answer
1

Since you're using virtual hosting to differentiate between different traffic formats, your HTTP server (lighttpd in this case) has to do the work of differentiating the traffic, which means all the traffic has to conform to HTTP spec. The best solution I can come up with is to allow HTTP proxy traffic (including specifically the CONNECT proxy method) with appropriate authorization of course, and then connect to SSH via your HTTP proxy.

Just be careful to not allow unauthenticated proxy traffic, or you will become a spam relay in a matter of minutes.