http3-ytproxy icon indicating copy to clipboard operation
http3-ytproxy copied to clipboard

Add the ability to listen on a port

Open RealOrangeOne opened this issue 4 years ago • 4 comments
trafficstars

Many reverse proxies and alike don't support forwarding to sockets (eg Traefik). This adds the ability to specify a $PORT to have it listen on that instead.

Note that by default the previous behaviour is maintained, for backwards compatibility.

RealOrangeOne avatar Sep 09 '21 19:09 RealOrangeOne

I feel like this be simplified by checking whether the environment variable is set, and not having multiple nested if else / complex control flow.

I'll create a separate PR for this.

FireMasterK avatar Sep 09 '21 19:09 FireMasterK

See #3 for my solution

FireMasterK avatar Sep 09 '21 19:09 FireMasterK

I'm not really a Go person, hence it's a bit thrown together. Although IMO #3 is more complex and harder to read.

RealOrangeOne avatar Sep 09 '21 20:09 RealOrangeOne

IMO #3 is more complex and harder to read.

It's all because I handle the socket/ folder not existing better there, instead of expecting the net.Listen("unix", socket) to fail to go back to TCP/IP, I just check if the folder exists.

FireMasterK avatar Sep 09 '21 20:09 FireMasterK