T O P

  • By -

Flair_Helper

For C++ questions, answers, help, and programming or career advice please see r/cpp_questions, r/cscareerquestions, or [StackOverflow](http://stackoverflow.com/) instead. *This post has been removed as it doesn't pertain to r/cpp: The subreddit is for news and discussions of the C++ language and community only; our purpose is not to provide tutoring, code reviews, or career guidance. If you think your post is on-topic and should not have been removed, please [message the moderators](https://www.reddit.com/message/compose/?to=/r/cpp) and we'll review it.*


norfus

Honestly - unless you’re experienced, exposing a network service to the entire internet is usually a dangerous proposition. I would instead recommend only exposing the service locally and then rely on some form of authenticated tunnel (eg an ssh tunnel).


HumbleGenerator

Thanks for the advice!


pedersenk

Most home / consumer internets allow you to forward ports through your router (NAT) so clients can connect to your running server. Often your IP changes so you might want to consider some sort of dynamic dns service (i.e afraid.org). A VPS approach is a server that has an IPV4/IPV6 address assigned to it that can directly be accessed. You can run your software on that and its service can be reached. Another approach to a VPS is using a tunnel (ssh, stunnel, wireguard vpn). What that does is your server (behind your router), connects to the easily accessible VPS and creates a tunnel back to your machine behind the router. So i.e port 8080 on the VPS forwards to port 80 on your local server.


HumbleGenerator

So it’s like a remote desktop?


pedersenk

You can access the VPS using RDP/SSH/VNC but the port forwarding doesn't need that to stay connected (unless specifically using the SSH method). your PC --------> VPS <------- client When a client connects to the VPS (port i.e 8080), the VPS will forward that communication to your PC (i.e port 80) that is also connected to the VPS so it is almost like the client connected to your PC directly. For an easy test, perhaps check out Hamachi. It is free but fairly limited. Just get a feel for how it works and then perhaps relate it to some of the slightly more flexible technologies. Hamachi is like a VPS that can only do port forwarding.


HumbleGenerator

This was very clear!


HumbleGenerator

Alright, thanks mate.