Port Forwarding


I think a nice feature to add to the IDE would be to port forward ports to the server. I would be great to have for when and if you ever need it for your code.

For example, I am experimenting with a blank workspace. I uploaded a minecraft server .jar and ran the java command from the terminal. From the IDE side, the server runs great! But, when I tried to connect through Minecraft, it didn’t work. I did some messing around and narrowed the problem down to the ports. So I used some PHP scripts and found the port that the server is using, which is 443. So I tried connecting using 443, but it didn’t work. And I think I know why.

First of all, the server.properties was on 25565, not 443. So I changed it and tried again, but to no avail. The server gave an error saying it couldn’t bind to the port and then shutdown.

Second of all, when I did try to connect using 25565, the connection timed out as if the port was closed.

When I used port 443 with the server IP address with the server running on 25565, the Minecraft client did something weird. It would say ‘Connecting to the Server…’ then say ‘Logging In…’ for a millisecond, and then say ‘Disconnected’. Nothing shows up on the log about logging in.

Anyway, if I could port forward port 25565 and other ports for plugins, this Minecraft server would be awesome. Port Forwarding is useful in general for any server.



I think you can do your port forwarding using iptables



Thank you for writing in. We only allow ports 8080, 8081, and 8082 to be available externally, and I’m not sure if and when we’ll be opening others since these appear to be more than enough for most developers. For bigger projects with more requirements, SSH workspaces can be used to circumvent the restriction.

One note about Minecraft servers it that this isn’t allowed, as Cloud9 is a development environment and running non-development related services can cause your account to be banned.



Thank you for your reply. I felt there would be limits somewhere on what the workspaces can be used for, but I didn’t know what. Thanks for clearing that up.

Although, what if I were to develop a plugin. Would that be a valid reason to use a minecraft server to test it out? Or would it just be better to download a .jar and test it out elsewhere?

Thanks :slight_smile:



Thank you for understanding :slight_smile:

I think running a server to develop plugins should be ok. However, if there is a lot of traffic being served from your workspace, that might cause it to be automatically flagged.

Have a great day and happy coding!



iptables isn’t available in Cloud9. You can install it but it won’t work because of Docker. See https://github.com/moby/moby/issues/33605#issuecomment-307361421 for a detailed explanation of why that it.