# 內網穿透 ## Ngrok 僅支援tcp和http。要使用其他協定如udp需換其他工具。 ## Reference https://zj-network-guide.readthedocs.io/zh-cn/latest/intranet-penetration/ngrok/[%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F]ngrok%E5%AE%9E%E7%8E%B0/ https://blog.csdn.net/adream307/article/details/104248742 ## ssh 內網穿透步驟 1. 創建帳號並登入 (https://ngrok.com/) (使用github) 2. 依指示下載並設定token  3. ```ngrok tcp 22```,輸入後會跳出控制介面 (遠端桌面: ```ngrok tcp 3389```)  4. 回到網頁dashboard點選Endpoints  5. ```ssh -p 15867 yucheng@0.tcp.jp.ngrok.io```,輸入密碼後成功連線  ## Frp ## 下載 https://github.com/fatedier/frp/releases ## Reference https://blog.csdn.net/qq_35427539/article/details/104001378 https://forum.gamer.com.tw/Co.php?bsn=25095&sn=14255 ## 內網穿透、反向代理步驟 1. 準備一個具有公網ip的proxy server。推薦AWS EC2服務 (https://aws.amazon.com/tw/)。記得調整防火牆設定。 2. ssh進入proxy server。 3. 下載frp並解壓縮。 ``` wget https://github.com/fatedier/frp/releases/download/v0.54.0/frp_0.54.0_linux_amd64.tar.gz tar zxvf frp_0.54.0_linux_amd64.tar.gz ``` 4. 執行frps。 ``` cd frp_0.54.0_linux_amd64/ ./frps ./frps -c ./frps.toml ``` 5. 回到真正的遊戲server端,同樣下載frp並修改設定檔frpc.toml。以帕魯為例,帕魯使用的是UDP with port 8211。 ``` serverAddr = "your proxy server ip" serverPort = 7000 [[proxies]] name = "test-udp" type = "udp" localIP = "127.0.0.1" localPort = 8211 remotePort = 8211 ``` 6. 執行frpc。 ``` .\frpc -c .\frpc.toml ``` 7. 終端顯示```start proxy success```和```incoming a new work connection for udp proxy, ip:7000```,即代理成功,代表成功將local端的port 8211 broadcast到公網ip的port 8211,在任何裝置上輸入ip:8211即可連線遊玩。
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up