• frp 简单使用配置记录。 Windows下 内网穿透 实现*使用远程桌面连接,代理web服务。


    frp项目地址:fatedier/frp: A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet. (github.com)

    服务器端配置:frps.ini 文件

    [common]
    
    bind_port = 7200  #基本端口 程序运行需要
    
    vhost_http_port = 8200 #http使用端口
    
    # auth token
    # token = 12345678
    dashboard_port = 7500 #控制面板访问端口
    
    # dashboard user and passwd for basic auth protect
    dashboard_user = userName
    dashboard_pwd = 123654789 

    客户端配置: frpc.ini 文件

    [common]
    server_addr = 你的服务端地址
    server_port = 7200 # frp服务器端运行端口 必填
    # auth token
    # token = 12345678
    
    #远程桌面配置
    [RDP]
    type = tcp
    local_ip = 127.0.0.1
    local_port = 3389 #本地 微软远程桌面默认使用端口
    remote_port = 6600 #服务器代理端口
    
    
    #web服务代理配置
    [webapi]
    type = http
    local_ip = 127.0.0.1
    local_port = 8080 #本地web服务访问端口
    remote_port = 8200  #服务器代理端口
    custom_domains =  你的服务端IP地址
    #为了兼容mqtt客户端连接 不使用域名了
     

    frp配置自启动 ,windows  service 服务封装:

    项目地址:winsw/winsw: A wrapper executable that can run any executable as a Windows service, in a permissive license. (github.com)

    使用步骤:

    1:新建/编辑 winsw.xml配置文件

    <service>
        <!-- 该服务的唯一标识 -->
        <id>frpc_office</id>
        <!-- 该服务的名称 -->
        <name>frpc_office</name>
        <!-- 该服务的描述 -->
        <description>frpc客户端 这个服务用 frpc 实现内网穿透</description>
        <!-- 要运行的程序路径 配置自己的 -->
        <executable>E:\Afrp\frpc.exe</executable>
        <!-- 携带的参数 -->
        <arguments> -c E:\Afrp\frpc.ini</arguments>
        <!-- 第一次启动失败 60秒重启 -->
        <onfailure action="restart" delay="60 sec"/>
        <!-- 第二次启动失败 120秒后重启 -->
        <onfailure action="restart" delay="120 sec"/>
        <!-- 日志模式 -->
        <logmode>append</logmode>
        <!-- 指定日志文件目录(相对于executable配置的路径) -->
        <logpath>logs</logpath>
    </service>

    2:执行对应命令:

    //注册服务
    winsw.exe install
    //卸载服务
    winsw.exe uninstall
    //启动服务
    winsw.exe start
    //停止服务
    winsw.exe stop
    //重启服务
    winsw.exe restart
    //查看状态
    winsw.exe status

    cd到程序目录 执行命令安装。

    效果:

  • 相关阅读:
    判断一个大于1的数是不是一个素数
    luogu P3241 [HNOI2015]开店
    换根DP
    CF1187E Tree Painting
    luogu P3345 [ZJOI2015]幻想乡战略游戏
    费用流
    FZOJ 4112 脱单计划
    计数DP
    FZOJ 4109 青青草原的表彰大会
    状压DP
  • 原文地址:https://www.cnblogs.com/camefor/p/16248956.html
Copyright © 2020-2023  润新知