http3-ytproxy
http3-ytproxy copied to clipboard
Add the ability to listen on a port
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.
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.
See #3 for my solution
I'm not really a Go person, hence it's a bit thrown together. Although IMO #3 is more complex and harder to read.
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.