Your local MCPM Router can be shared in public network and others can connect to your router by the share link and use your configured MCPM Profile. In this document, we will explain how to use it and how it works.
mcpm router share
mcpm router share --profile <PROFILE_NAME> --address <ADDRESS>
There will be a share link and a secret. The final share link will be http://<ADDRESS>?s=<SECRET>&profile=<PROFILE_NAME>
. You can share this link with others and by adding this share link to mcpm client, they can connect to your router.
If address is not specified, the share link will be proxied by our server share.mcpm.sh
. You can also specify a custom address to share.
If profile is not specified, the share link will use the current active profile. If no active profile found, the user need to specify the profile manually.
To be noted that if your router is not on or your system sleeps, the shared link will not be accessible.
We use a fork version of frp from huggingface/frp to create a tunnel to your local MCPM Router. You can also check the original frp for more details about frp.
If you want to set up your own frp tunnel, you can either build our docker image from scratch or use our published docker images for frps(server) and frpc(client) by following the instructions below.
In your public server, you can create a frps config following the guide here. Then start the frps container by:
docker run -d --name frps -p 7000:7000 -p 7001:7001 -v /path/to/frps.ini:/frp/frps.ini ghcr.io/pathintegral-institute/frps:latest
Then you can share the router with your own frp server by specifying the address:
mcpm router share --address <YOUR_ADDRESS>
There will be a secret token generated for authentication. The user MUST specify the secret token as a query parameter s=<SECRET>
when connecting to your router. Make sure to keep the secret token secure and only share it with trusted users.
mcpm router unshare
This will stop the tunnel and remove the share link.