使用Frp搭建内网穿透

这个不算技术,最多算个工具!

事情是这样的,去年我们公司采用本地化代码托管,也就是本地的GitLab,本地虽然安全,速度快,但是外网缺无法访问,所以这就导致部分同事在家就不能享受加班的待遇了,去年我老大用另一种比较牛逼的工具搭建了一个,我没学会,然后另辟蹊径搞了这个简单点的!废话就不多说了

环境准备

1.一台公网服务器Linux/Windows
2.本地一台电脑
3.本地电脑上跑一个服务

公网代理机-内网穿透服务端搭建

1.下载对应系统版本的安装包
GitHub-Frp下载地址
在这里插入图片描述
点击Tags可选择Frp的版本

这里下载草鸡慢,这里教大家一个提速的办法!GitHub下载提速

2.将下载好的压缩包上传公网服务器并解压
在这里插入图片描述

3.修改配置文件
注意:frpc、frpc.ini和frps、frps.ini,前者两个文件是客户端所关注文件,后者两个文件是服务端所关注两个文件。

编辑配置

vi ./frpc.ini

在这里插入图片描述

[common]
# tunnel port通信管道
bind_port = 7000(外网通信端口)
# http和https
vhost_http_port = 82 (外网代理端口)
vhost_https_port = 443
# 连接认证token
#token = 123456

# 子域名
subdomain_host = live.xxx.com   (外网域名)

# 自定义404 页面,要用绝对路径哦!
custom_404_page = /root/frp_0.27.0_linux_amd64/404.html

# dashboard图形管理页面
dashboard_port = 81 (图形化控制台端口)

dashboard_user = admin
dashboard_pwd = admin

4.启动Frp服务端
linux系统上有两种运行方式
前台启动./frps -c ./frps.ini
后台启动nohup ./frps -c ./frps.ini &

注意开启81,82,7000端口

如果提示frps没有执行权限
chmod 777 frps 即可

在这里插入图片描述

5.访问WEB控制台

公网IP+配置web的端口

第一次访问会输入账号密码,也是上面配置中配的
在这里插入图片描述
Frp服务端启动成功!

本地-客户端搭建

这里大多数博客都是直接用公网的压缩包拿来运行在本地!Windows系统下可能运行失败!
这里我是从新下载了一个Windows系统的压缩包,因为我就没运行成功!

1.下载对应版本-系统的压缩包
还是上面下载公网上的压缩包的地址,只不过是下载的系统不同而已!
在这里插入图片描述
速度慢可以使用迅雷下载!

2.删除客户端配置文件

在这里插入图片描述
3.修改客户端配置文件
在这里插入图片描述

[common]
server_addr = xxx.xxx.xxx.xxx(外网服ip)
server_port = 7000	(外网通信端口)

[ssh]
type = tcp              
local_ip = 192.168.0.99 (本地ip)
local_port = 22         
remote_port = 6000      


#公网访问内部web服务器以http方式
[web]
type = http       
local_port = 9020	(本地需要代理的端口)
local_ip = 192.168.0.99	(本地ip)
custom_domains = live.........com (外网域名)
remote_port = 82	(代理端口)

4.启动Frp客户端
在这里插入图片描述
在这里插入图片描述

.\frpc.exe

5.查看服务端连接数
在这里插入图片描述
连接成功,我这里还配置了TCP的就不过多演示了!,上面的82就是代理端口!

启动本地服务测试内网穿透

1.启动java服务
在这里插入图片描述
2.访问公网ip、域名测试
在这里插入图片描述
3.本地服务端控制台打印
在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
Preface..................................................................................................................................9 Organization of This Book........................................................................................9 Conventions Used in This Book..............................................................................9 How to Contact Us....................................................................................................10 Acknowledgments.....................................................................................................11 Chapter 1. Introduction.....................................................................................................13 1.1 What Is the Microsoft .NET Framework?..................................................13 1.2 What Is Visual Basic .NET?............................................................................14 1.3 An Example Visual Basic .NET Program...................................................14 Chapter 2. The Visual Basic .NET Language...............................................................23 2.1 Source Files.........................................................................................................23 2.2 Identifiers.............................................................................................................23 2.3 Keywords..............................................................................................................24 2.4 Literals...................................................................................................................27 2.5 Types......................................................................................................................31 2.6 Namespaces........................................................................................................40 2.7 Symbolic Constants..........................................................................................42 2.8 Variables...............................................................................................................43 2.9 Scope......................................................................................................................44 2.10 Access Modifiers..............................................................................................44 2.11 Assignment........................................................................................................45 2.12 Operators and Expressions.........................................................................46 2.13 Statements........................................................................................................52 2.14 Classes................................................................................................................60 2.15 Interfaces...........................................................................................................85 2.16 Structures..........................................................................................................88 2.17 Enumerations...................................................................................................91 2.18 Exceptions..........................................................................................................93 2.19 Delegates...........................................................................................................98 2.20 Events................................................................................................................101 2.21 Standard Modules.........................................................................................104 2.22 Attributes.........................................................................................................104 2.23 Conditional Compilation.............................................................................108 2.24 Summary..........................................................................................................109 Chapter 3. The .NET Framework..................................................................................111 3.1 Common Language Infrastructure (CLI) and Common Language Runtime (CLR)..........................................................................................................111 3.2 Common Type System (CTS).....................................................................111 3.3 Portions of the CLI..........................................................................................112 3.4 Modules and Assemblies...............................................................................113 3.5 Application Domains.......................................................................................116 3.6 Common Language Specification (CLS).................................................116 3.7 Intermediate Language (IL) and Just-In-Time (JIT) Compilation117 3.8 Metadata.............................................................................................................117 3.9 Memory Management and Garbage Collection....................................118 3.10 A Brief Tour of the .NET Framework Namespaces...........................122 Programming Visual Basic .NET 3 3.11 Configuration...................................................................................................125 3.12 Summary..........................................................................................................131 Chapter 4. Windows Forms I: Developing Desktop Applications.............................133 4.1 Creating a Form................................................................................................133 4.2 Handling Form Events....................................................................................143 4.3 Relationships Between Forms.....................................................................145 4.4 MDI Applications...............................................................................................147 4.5 Component Attributes....................................................................................155 4.6 2-D Graphics Programming with GDI+...................................................160 4.7 Printing.................................................................................................................174 4.8 Summary.............................................................................................................186 Chapter 5. Windows Forms II: Controls, Common Dialog Boxes, and Menus......187 5.1 Common Controls and Components.........................................................187 5.2 Control Events...................................................................................................204 5.3 Form and Control Layout..............................................................................204 5.4 Common Dialog Boxes...................................................................................210 5.5 Menus...................................................................................................................215 5.6 Creating a Control...........................................................................................227 5.7 Summary.............................................................................................................236 Chapter 6. ASP.NET and Web Forms: Developing Browser-Based Applications237 6.1 Creating a Web Form.....................................................................................238 6.2 Handling Page Events.....................................................................................251 6.3 More About Server Controls........................................................................253 6.4 Adding Validation.............................................................................................268 6.5 Using Directives to Modify Web Page Compilation.............................283 6.6 ASP.NET Objects: Interacting with the Framework...........................291 6.7 Discovering Browser Capabilities...............................................................296 6.8 Maintaining State.............................................................................................298 6.9 Application-Level Code and global.asax.................................................304 6.10 Web-Application Security...........................................................................307 6.11 Designing Custom Controls.......................................................................320 6.12 Summary..........................................................................................................328 Chapter 7. Web Services................................................................................................329 7.1 Creating a Web Service.................................................................................329 7.2 Testing a Web Service with a Browser....................................................333 7.3 Web-Service Descriptions.............................................................................335 7.4 Consuming a Web Service............................................................................335 7.5 Web-Service Discovery..................................................................................340 7.6 Limitations of Web Services........................................................................340 7.7 Summary.............................................................................................................341 Chapter 8. ADO.NET: Developing Database Applications.......................................343 8.1 A Brief History of Universal Data Access................................................343 8.2 Managed Providers..........................................................................................343 8.3 Connecting to a SQL Server Database....................................................344 SQL Server Authentication.............................................................................................347 8.4 Connecting to an OLE DB Data Source...................................................348 8.5 Reading Data into a DataSet.......................................................................349 4 8.6 Relations Between DataTables in a DataSet........................................360 8.7 The DataSet's XML Capabilities.................................................................362 8.8 Binding a DataSet to a Windows Forms DataGrid..............................364 8.9 Binding a DataSet to a Web Forms DataGrid.......................................367 8.10 Typed DataSets.............................................................................................368 8.11 Reading Data Using a DataReader.........................................................370 8.12 Executing Stored ProceduresThrough a SqlCommand Object....371 8.13 Summary..........................................................................................................374 Appendix A. Custom Attributes Defined in the System Namespace......................375 Appendix B. Exceptions Defined in the System Namespace...................................381 Appendix D. Resources for Developers......................................................................391 D.1 .NET Information.............................................................................................391 D.2 Discussion Lists................................................................................................392 Netiquette.........................................................................................................................392 Appendix E. Math Functions..........................................................................................395 Colophon...........................................................................................................................398

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序员劝退师-TAO

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值