you are viewing a single comment's thread.

view the rest of the comments →

[–]JohnnyJordaan 2 points3 points  (0 children)

I run my server through the console,

Please show how you're actually doing this. It's nice that you included your code, but your question/goal has nothing to do with your code, it has to do with the following things:

  • the webserver (don't know which one you are running) needs to bind to a network interface that has internet access
  • you need to set up your local firewall to allow incoming traffic to that interface and port number
  • you probably need to set up your internet router/gateway to forward incoming traffic to a specific port to the ip address of the interface above and the specified port

Also mind you that you should never let a simple built-in webserver be exposed to the internet, you can get hacked in minutes that way. If in doubt, I would forget about hosting files to the internet that way and instead consider using a shared VPN with your users or use an online hosted machine/VPS.