You can use FRP (Fast Reverse Proxy) to expose a remote desktop service (like VNC, RDP, TeamViewer, etc.) from a machine that is behind a NAT or firewall to the internet. Here’s a general guide on how you could achieve this using VNC as an example. Please be aware of the security implications and ensure the remote desktop service is secured properly:
On the FRP Server (Your Public Server)
You need to set up the FRP server on a machine that is publicly accessible on the internet. This could be a VPS or any server you have public access to.
Here is an example configuration frps.ini
for the FRP server:
[common]
bind_port = 7000
Start the FRP server with ./frps -c ./frps.ini
.
On the FRP Client (Machine with VNC Server)
Install a VNC Server like TightVNC, RealVNC, etc. Note down the port number the VNC Server is running on, typically this is 5901.
Create a FRP client configuration file frpc.ini
:
[common]
server_addr = [Your_Public_Server_IP]
server_port = 7000
[vnc]
type = tcp
local_ip = 127.0.0.1
local_port = 5901
remote_port = 6000
In the [vnc]
section, local_ip
and local_port
refer to your VNC server address and port, while remote_port
is the port that will be exposed on your public FRP server.
Start the FRP client with ./frpc -c ./frpc.ini
.
Now, you should be able to access the VNC Server from any VNC client by connecting to [Your_Public_Server_IP]:6000
.
Remember, exposing a VNC server or any other remote desktop service to the public internet has security implications. Always ensure you use strong passwords, consider using encryption if supported by your remote desktop service, and keep your software up-to-date to minimize potential risks.