UDP-to-TCP-to-HTTP proxying

OK, so first of all, I apologize for creating this monstrosity.

Why does the server stop working if I am running an UDP socket like this? I’m not using $PORT to directly expose it, I’m trying to proxy it through socat and chisel - please see my questionable glitch.json.

I have a project which successfully proxies through a TCP socket using the same chisel: https://glitch.com/~java-socket

This is pretty fancy stuff; I am not sure I can help much.

Just as a thing to try, I would suggest avoiding running the udp server on the very same port number (is it SPORT? or 8000?) that you’re intending to receive traffic from the internet on.

You might want to pull your long command line out into a shell script so glitch.json looks like: “start”: “bash start.sh”

Maybe using Node.js / package.json instead of Java and glitch.json would also reduce the number of slightly-novel-or-experimental things that you’re trying to do simultaneously? For example, I recently wrote ~jenny-design-of-experiments - it’s not doing anything nearly as clever as your project but it’s a Node.js wrapper around a C executable. You could implement this shell script functionality using JS, and it might be more debuggable?

For example, you could start by opening the tcp socket that you want Glitch to connect to, process.env.PORT or 3000 or whatever. Then, after you see that working, start the local (udp?) server. Does it work better if you open the local server first? second?

I admire your audacity, and I hope you figure out something cool!

Hope this helps,