mac m1 配置 frp

frp 是什么?

frp 是一个专注于内网穿透的高性能的反向代理应用,支持 TCP、UDP、HTTP、HTTPS 等多种协议。可以将内网服务以安全、便捷的方式通过具有公网 IP 节点的中转暴露到公网。

官网 github

安装

配置公网服务器

下载服务端二进制文件,下载地址:https://github.com/fatedier/frp/releases

bash 复制代码
# 下载
wget https://github.com/fatedier/frp/releases/download/v0.37.0/frp_0.37.0_linux_amd64.tar.gz



# 解压
tar -zxvf frp_0.37.0_linux_amd64.tar.gz
cd frp_0.37.0_linux_amd64
sudo nano frps.ini

frps.ini配置文件如下:

bash 复制代码
[common]
bind_port = 7000 ;客户端连接到该服务器的端口号
dashboard_port = 7002 ; 服务端仪表板的端口号
token = mytoken ; 客户端和服务端连接的token
dashboard_user = admin ; 仪表盘登录名
dashboard_pwd = pwd ; 仪表盘登录密码
vhost_http_port = 8080 ; 连接到客户端http服务时访问公网服务器的端口号
bash 复制代码
# 启动服务端
nohup ./frps -c frps.ini &

配置客户端

下载服务端二进制文件,下载地址:https://github.com/fatedier/frp/releases

bash 复制代码
wget https://github.com/fatedier/frp/releases/download/v0.37.0/frp_0.37.0_darwin_arm64.tar.gz

解压到本地目录

配置,frpc.ini配置文件如下:

bash 复制代码
[common]
server_addr = 123.123.123.123 ;公网ip
server_port = 7000 ; 服务端与客户端连接的端口号,即 bind_port
token = mytoken ; 服务端配置的token

[mac-test-web]
type = http ;转发的协议类型
local_port = 5000 本地监听的端口
custom_domains = www.yourdomain.com // 指向服务端的域名
bash 复制代码
# 启动
./frpc -c frpc.ini

测试

启动本地web服务,端口为5000,在任意机器上访问 www.yourdomain.com:8080 , 查看是否能访问到本地的web服务。

参考

mac m1配置frp | 虎嗅蔷薇

相关推荐
Cosmoshhhyyy5 小时前
mac环境下安装git并配置密钥等
git·macos
肥肥呀呀呀11 小时前
mac 安卓模拟器 blueStacks
macos
csdn_aspnet11 小时前
如何在 MacOS 上安装 SQL Server
macos·sqlserver
共享家95272 天前
linux-数据链路层
linux·网络·macos
CZIDC2 天前
MacOS字体看起来比在 Windows 上更好?
macos
Cosmoshhhyyy2 天前
linux远程部署dify和mac本地部署dify
linux·运维·macos
行星0082 天前
mac 通过homebrew 安装和使用nvm
macos·npm·node.js
2501_928094653 天前
Mac电脑录屏工具 Omi录屏专家(Mac中文)
macos·mac·录屏工具·omi
森之鸟3 天前
Mac chrome浏览器下载DevEco Studio 6.0.0 Beta2失败
前端·chrome·macos