当前位置:首页 » 编程软件 » ngrok编译

ngrok编译

发布时间: 2022-11-07 16:18:42

1. 内网穿透工具哪个品牌的靠谱

NAPT原理:

在NAT网关上会有一张映射表,表上记录了内网向公网哪个IP和端口发起了请求,然后如果内网有主机向公网设备发起了请求,内网主机的请求数据包传输到了NAT网关上,那么NAT网关会修改该数据包的源IP地址和源端口为NAT网关自身的IP地址和任意一个不冲突的自身未使用的端口,并且把这个修改记录到那张映射表上。最后把修改之后的数据包发送到请求的目标主机,等目标主机发回了响应包之后,再根据响应包里面的目的IP地址和目的端口去映射表里面找到该转发给哪个内网主机。这样就实现了内网主机在没有公网IP的情况下,通过NAPT技术借助路由器唯一的一个公网IP来访问公网设备。 具体原理参照上图。

10款内网穿透工具:

1、Ngrok

ngrok 是一个反向代理,通过在公共端点和本地运行的 Web 服务器之间建立一个安全的通道,实现内网主机的服务可以暴露给外网。ngrok 可捕获和分析所有通道上的流量,便于后期分析和重放,所以ngrok可以很方便地协助服务端程序测试。

参考博客:10分钟教你搭建自己的ngrok服务器
https://blog.csdn.net/yjc_1111/article/details/79353718

2、Natapp

natapp是 基于ngrok的国内收费内网穿透工具,类似花生壳,有免费版本,比花生壳好。免费版本:提供http,https,tcp全隧道穿透,随机域名/TCP端口,不定时强制更换域名/端口,自定义本地端口。

参考文章:NATAPP1分钟快速新手图文教程
https://natapp.cn/article/natapp_newbie

3、小米球

小米球是基于ngrok二次开发的内网穿透工具,支持多协议、多隧道、多端口同时映射(http、https、tcp等等...),同时支持多种系统win、linux、linux_arm、mac等。具体的使用直接参考官网。

4、Sunny-Ngrok

Sunny-Ngrok同样是ngrok二次开发的内网穿透工具,支持http,https协议,同时支持更丰富的系统和语言:linux、win、mac、openwrt、 pythonphp等。

教程:Sunny-Ngrok使用教程
https://www.ngrok.cc/_book/

5、echosite

echosite同样ngrok二次开发的内网穿透工具,支持多种协议,以前是全部免费的,现在推出了收费版和免费版,可根据自己的需要去选择。

参考教程:EchoSite---让内网穿透变得简单
https://blog.csdn.net/interesting0303/article/details/81098603

6、Ssh、autossh

ssh 配合autossh工具使用,因为autossh会容错,自动重新启动SSH会话和隧道。autossh是一个程序,用于启动ssh的副本并进行监控,在死亡或停止传输流量时根据需要重新启动它。 这个想法来自rstunnel(Reliable SSH Tunnel),但是在C中实现。作者的观点是,它不像匆匆忙忙的工作那么容易。使用端口转发环路或远程回显服务进行连接监视。在遇到连接拒绝等快速故障时,关闭连接尝试的速度。在OpenBSD,Linux,Solaris,Mac OS X,Cygwin和AIX上编译和测试; 应该在其他BSD上工作。免费软件。

使用教程:SSH内网穿透
https://yangqiang.im/?p=698

7、Lanproxy

lanproxy是一个将局域网个人电脑、服务器代理到公网的内网穿透工具,目前仅支持tcp流量转发,可支持任何tcp上层协议(访问内网网站、本地支付接口调试、ssh访问、远程桌面...)。目前市面上提供类似服务的有花生壳、TeamView、GoToMyCloud等等,但要使用第三方的公网服务器就必须为第三方付费,并且这些服务都有各种各样的限制,此外,由于数据包会流经第三方,因此对数据安全也是一大隐患。

参考教程:业余草推荐一款局域网(内网)穿透工具lanproxy
https://blog.csdn.net/xmtblog/article/details/77943159

8、Spike

Spike是一个可以用来将你的内网服务暴露在公网的快速的反向代理,基于ReactPHP,采用IO多路复用模型。采用Php实现。

参考教程:使用 PHP 实现的的内网穿透工具 “Spike”
https://segmentfault.com/q/1010000009955702

9、Frp

frp 是一个可用于内网穿透的高性能的反向代理应用,支持 tcp, udp, http, https 协议。利用处于内网或防火墙后的机器,对外网环境提供 http 或 https 服务。对于 http, https 服务支持基于域名的虚拟主机,支持自定义域名绑定,使多个域名可以共用一个80端口。利用处于内网或防火墙后的机器,对外网环境提供 tcp 和 udp 服务,例如在家里通过 ssh 访问处于公司内网环境内的主机。

教程:一款很好用的内网穿透工具--FRP、使用frp实现内网穿透
https://sunnyrx.com/2016/10/21/simple-to-use-frp/

10、Fcn

FCN[free connect]是一款傻瓜式的一键接入私有网络的工具, fcn利用公共服务器以及数据加密技术实现:在免公网IP环境下,在任意联网机器上透明接入服务端所在局域网网段。支持多种系统,有免费版和付费版。

教程:内网穿透工具FCN介绍
http://www.sohu.com/a/202331135_449548

不建议把这些免费的穿透工具去放到比较重要的云服务器中去使用,容易被攻击。

2. 有没有简单的内网穿透工具


端口映射”通俗来说就是将外网主机的IP地址端口映射到内网中一台机器,提供相应的服务。内网相通,电因特网对外开放服务或者接收大数据,都需要端口映射。首先,想要做好端口映射,确定路由器,清楚的认识软件需要开放什么端口号,设置独立固定的Ip地址,关闭主机防火墙,检查wan口获取的Ip是否是公网Ip,最后就是测试。

之前市场上有很多免费版的端口映射工具,现如今基本上都收费了;且测试后,感觉有部分付费的效果也不尽人意。后来测试一款试用的,综合使用后感觉挺稳定,个人开发测试与商用都挺合适,因为我是用来实现再家可以远程访问公司内部的文件,工作需要,没有公网ip很不方便。这个法子挺好用,使用教程如下:

需要的工具:

网云穿内网穿透

一个可以正常上网的电脑

网云穿是一款可以在包括但不限于Windows、Mac、Linux、群辉、树莓派、威联通上使用的内网穿透,它可以很便捷的帮助你将本地内网的应用发布出去,比如:网站、数据库、硬盘文件、远程桌面、应用、游戏(如我的世界)等等,这样您就可以很方便的微信调试、自建云盘、异地办公等等,它不需要您有公网IP、不需要您有服务器、也不需要您设置任何路由器,只需要您安装软件进行简单设置即可直接使用。WIndows使用网云穿穿透3389远程桌面首先我们开启被远程那台电脑的远程桌面访问功能(因为这个网云穿只需要安装在被远程的电脑上即可

3. linux ngrok怎么使用

下面使用的介绍

ngrok.exe -config ngrok.cfg -subdomain bisouyi 8989

-config 指定配置文件
-subdomain 指定二级域名
8989 是指定映射到本地的哪一个端口
配置文件一般不用管,简单到令人发指.
运行完命令,就能看到,它已经在运行了

当状态是online的时候,就说明它已经运行正常了,现在用户就可以通过访问http://bisouyi.tunnel.mobi来访问你本地的应用了,访问这个地址,就相当于是访问了 http://localhost:8989/,因为我们上面指定了映射到本地的8989端口的.
这个在我们开发微信公众号或者微博接口的时候,需要回调的时候特别有用.
我们看到,它还监听了本地的4040端口,来看一下是什么.

我们可以看到通过我们的这个域名,访问进来的第一个请求,以及每一个请求的详细信息,包括请求响应头,并且我们可以指定一个请求,直接再发送一次这个请求,WOW,真心强大
我在用的版本,提供给大家下载使用吧:

4. cmd无法识别ngrok命令是什么情况

要先进到ngrok.cfg的路径下,在执行命令才行。
ngrok配置方法
1、下载ngrok源码
(GOPATH=~/goproj)
$ mkdir ~/goproj/src/github.com/inconshreveable
$ git clone https://github.com/inconshreveable/ngrok.git
$ export GOPATH=~/goproj/src/github.com/inconshreveable/ngrok
2、生成自签名证书
使用ngrok.com官方服务时,我们使用的是官方的SSL证书。自建ngrokd服务,我们需要生成自己的证书,并提供携带该证书的ngrok客户端。
证书生成过程需要一个NGROK_BASE_DOMAIN。 以ngrok官方随机生成的地址693c358d.ngrok.com为例,其NGROK_BASE_DOMAIN就是"ngrok.com",如果你要 提供服务的地址为"example.tunnel.tony.com",那NGROK_BASE_DOMAIN就应该 是"tunnel.tony.com"。
我们这里以NGROK_BASE_DOMAIN="tunnel.tony.com"为例,生成证书的命令如下:
$ cd ~/goproj/src/github.com/inconshreveable/ngrok
$ openssl genrsa -out rootCA.key 2048
$ openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=tunnel.tony.com" -days 5000 -out rootCA.pem
$ openssl genrsa -out device.key 2048
$ openssl req -new -key device.key -subj "/CN=tunnel.tony.com" -out device.csr
$ openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 5000
执行完以上命令,在ngrok目录下就会新生成6个文件:
-rw-rw-r– 1 ubuntu ubuntu 1001 Mar 14 02:22 device.crt
-rw-rw-r– 1 ubuntu ubuntu 903 Mar 14 02:22 device.csr
-rw-rw-r– 1 ubuntu ubuntu 1679 Mar 14 02:22 device.key
-rw-rw-r– 1 ubuntu ubuntu 1679 Mar 14 02:21 rootCA.key
-rw-rw-r– 1 ubuntu ubuntu 1119 Mar 14 02:21 rootCA.pem
-rw-rw-r– 1 ubuntu ubuntu 17 Mar 14 02:22 rootCA.srl
ngrok通过bindata将ngrok源码目录下的assets目录(资源文件)打包到可执行文件(ngrokd和ngrok)中 去,assets/client/tls和assets/server/tls下分别存放着用于ngrok和ngrokd的默认证书文件,我们需要将它们替换成我们自己生成的:(因此这一步务必放在编译可执行文件之前)
cp rootCA.pem assets/client/tls/ngrokroot.crt
cp device.crt assets/server/tls/snakeoil.crt
cp device.key assets/server/tls/snakeoil.key
3、编译ngrokd和ngrok
在ngrok目录下执行如下命令,编译ngrokd:
$ make release-server
不过在我的AWS上,出现如下错误:
GOOS="" GOARCH="" go get github.com/jteeuwen/go-bindata/go-bindata
bin/go-bindata -nomem -pkg=assets -tags=release \
-debug=false \
-o=src/ngrok/client/assets/assets_release.go \
assets/client/…
make: bin/go-bindata: Command not found
make: *** [client-assets] Error 127
go-bindata被安装到了$GOBIN下了,go编译器找不到了。修正方法是将$GOBIN/go-bindata拷贝到当前ngrok/bin下。
$ cp /home/ubuntu/.bin/go14/bin/go-bindata ./bin
再次执行make release-server。
~/goproj/src/github.com/inconshreveable/ngrok$ make release-server
bin/go-bindata -nomem -pkg=assets -tags=release \
-debug=false \
-o=src/ngrok/client/assets/assets_release.go \
assets/client/…
bin/go-bindata -nomem -pkg=assets -tags=release \
-debug=false \
-o=src/ngrok/server/assets/assets_release.go \
assets/server/…
go get -tags 'release' -d -v ngrok/…
code.google.com/p/log4go (download)
go: missing Mercurial command. See http://golang.org/s/gogetcmd
package code.google.com/p/log4go: exec: "hg": executable file not found in $PATH
github.com/gorilla/websocket (download)
github.com/inconshreveable/go-update (download)
github.com/kardianos/osext (download)
github.com/kr/binarydist (download)
github.com/inconshreveable/go-vhost (download)
github.com/inconshreveable/mousetrap (download)
github.com/nsf/termbox-go (download)
github.com/mattn/go-runewidth (download)
github.com/rcrowley/go-metrics (download)
Fetching https://gopkg.in/yaml.v1?go-get=1
Parsing meta tags from https://gopkg.in/yaml.v1?go-get=1 (status code 200)
get "gopkg.in/yaml.v1": found meta tag main.metaImport{Prefix:"gopkg.in/yaml.v1", VCS:"git", RepoRoot:"https://gopkg.in/yaml.v1"} at https://gopkg.in/yaml.v1?go-get=1
gopkg.in/yaml.v1 (download)
make: *** [deps] Error 1
又出错!提示找不到hg,原来是aws上没有安装hg。install hg后(sudo apt-get install mercurial),再编译。
$ make release-server
bin/go-bindata -nomem -pkg=assets -tags=release \
-debug=false \
-o=src/ngrok/client/assets/assets_release.go \
assets/client/…
bin/go-bindata -nomem -pkg=assets -tags=release \
-debug=false \
-o=src/ngrok/server/assets/assets_release.go \
assets/server/…
go get -tags 'release' -d -v ngrok/…
code.google.com/p/log4go (download)
go install -tags 'release' ngrok/main/ngrokd
同样编译ngrok:
$ make release-client
bin/go-bindata -nomem -pkg=assets -tags=release \
-debug=false \
-o=src/ngrok/client/assets/assets_release.go \
assets/client/…
bin/go-bindata -nomem -pkg=assets -tags=release \
-debug=false \
-o=src/ngrok/server/assets/assets_release.go \
assets/server/…
go get -tags 'release' -d -v ngrok/…
go install -tags 'release' ngrok/main/ngrok
AWS上ngrokd和ngrok被安装到了$GOBIN下。
三、调试
1、启动ngrokd
$ ngrokd -domain="tunnel.tony.com" -httpAddr=":8080" -httpsAddr=":8081"
[03/14/15 04:47:24] [INFO] [registry] [tun] No affinity cache specified
[03/14/15 04:47:24] [INFO] [metrics] Reporting every 30 seconds
[03/14/15 04:47:24] [INFO] Listening for public http connections on [::]:8080
[03/14/15 04:47:24] [INFO] Listening for public https connections on [::]:8081
[03/14/15 04:47:24] [INFO] Listening for control and proxy connections on [::]:4443
… …

5. 《科学》(20220513出版)一周论文导读

编译 | 未玖

Science , 13 MAY 2022, VOL 376, ISSUE 6594

《科学》 2022年5月13日,第376卷,6594期


物理学 Physics


Quantum gas micros of Kardar-Parisi-Zhang superdiffusion

KPZ超扩散的量子气体显微镜

作者:DAVID WEI, ANTONIO RUBIO-ABADAL, BINGTIAN YE, FRANCISCO MACHADO, JACK KEMP, KRITSANA SRAKAEW, ET AL.

链接:

https://www.science.org/doi/10.1126/science.abk2397

摘要:

Kardar-Parisi-Zhang(KPZ)普适性类描述了大量经典随机模型的粗粒度行为。令人惊讶的是,最近人们推测KPZ普适性也可用于描述一维量子海森堡模型中的自旋输运。

研究组通过多达50个自旋的自旋链畴壁弛豫,在冷原子量子模拟器中实验探测输运来验证这个猜想。他们发现,畴壁弛豫确实由KPZ动力学指数z=3/2控制,KPZ标度的出现需要可积性和非阿贝尔SU(2)对称性。

最后,研究组利用量子气体显微镜实现的单自旋敏感性探测,来测量基于自旋输运统计的可观测数据。该研究结果产生了一个明确的非线性特征,这是KPZ普适性的一个标志。

Abstract:

The Kardar-Parisi-Zhang (KPZ) universality class describes the coarse-grained behavior of a wealth of classical stochastic models. Surprisingly, KPZ universality was recently conjectured to also describe spin transport in the one-dimensional quantum Heisenberg model. We tested this conjecture by experimentally probing transport in a cold-atom quantum simulator via the relaxation of domain walls in spin chains of up to 50 spins. We found that domain-wall relaxation is indeed governed by the KPZ dynamical exponent z = 3/2 and that the occurrence of KPZ scaling requires both integrability and a nonabelian SU(2) symmetry. Finally, we leveraged the single-spin–sensitive detection enabled by the quantum gas microscope to measure an observable based on spin-transport statistics. Our results yield a clear signature of the nonlinearity that is a hallmark of KPZ universality.


Observing emergent hydrodynamics in a long-range quantum magnet

在长程量子磁体中观测新兴流体动力学

作者:M. K. JOSHI, F. KRANZL, A. SCHUCKERT, I. LOVAS, C. MAIER, R. BLATT, ET AL.

链接:

https://www.science.org/doi/10.1126/science.abk2400

摘要:

确定非平衡量子态的普适性质是现代物理学的一个重大挑战。一个有趣的预测是,经典流体力学普遍出现在任何相互作用的量子系统演化中。

研究组通过实验探测了51个单独控制离子的量子动力学,实现了长程相互作用的自旋链。通过测量无限温度状态下的时空分辨关联函数,他们观测到了整个从正常扩散到反常超扩散的流体动力学普适性类家族,均由Lévy飞行描述。

研究组提取了流体力学理论的输运系数,反映了系统的微观性质。该结果表明,工程量子系统有潜力为量子物质非平衡态的普适性提供关键见解。

Abstract:

Identifying universal properties of nonequilibrium quantum states is a major challenge in modern physics. A fascinating prediction is that classical hydrodynamics emerges universally in the evolution of any interacting quantum system. We experimentally probed the quantum dynamics of 51 inpially controlled ions, realizing a long-range interacting spin chain. By measuring space-time–resolved correlation functions in an infinite temperature state, we observed a whole family of hydrodynamic universality classes, ranging from normal diffusion to anomalous superdiffusion, that are described by Lévy flights. We extracted the transport coefficients of the hydrodynamic theory, reflecting the microscopic properties of the system. Our observations demonstrate the potential for engineered quantum systems to provide key insights into universal properties of nonequilibrium states of quantum matter.


材料科学 Materials Science


Highly enhanced ferroelectricity in Hf O2 -based ferroelectric thin film by light ion bombardment

轻离子轰击增强HfO2基铁电薄膜的铁电性

作者:SEUNGHUN KANG, WOO-SUNG JANG, ANNA N. MOROZOVSKA, OWOONG KWON, YEONGROK JIN, YOUNG-HOON KIM, et al.

链接:

https://www.science.org/doi/10.1126/science.abk3195

摘要:

非易失和准同型的后摩尔电子器件的不断发展需要集成铁电材料和半导体材料。与原子层沉积兼容的氧化铪(Hf O2 )基铁电体的出现开辟了有趣且颇有前景的研究途径。然而,Hf O2 中铁电性的起源和控制途径仍然是个谜。

研究组证明了局部氦(He)注入可以激活这些材料中的铁电性。他们还分析了可能的竞争机制,包括He离子引发的摩尔体积变化、空位再分布、空位生成和空位迁移率的激活。

这些发现既揭示了该系统中铁电性的起源,也为纳米工程二元铁电体开辟了新途径。

Abstract:

Continuous advancement in nonvolatile and morphotropic beyond-Moore electronic devices requires integration of ferroelectric and semiconctor materials. The emergence of hafnium oxide (Hf O2 )–based ferroelectrics that are compatible with atomic-layer deposition has opened interesting and promising avenues of research. However, the origins of ferroelectricity and pathways to controlling it in Hf O2 are still mysterious. We demonstrate that local helium (He) implantation can activate ferroelectricity in these materials. The possible competing mechanisms, including He ion–inced molar volume changes, vacancy redistribution, vacancy generation, and activation of vacancy mobility, are analyzed. These findings both reveal the origins of ferroelectricity in this system and open pathways for nanoengineered binary ferroelectrics


Ultrafast water permeation through nanochannels with a densely fluorous interior surface

内表面致密氟纳米通道可超快渗透水

作者:YOSHIMITSU ITOH, SHUO CHEN, RYOTA HIRAHARA, TAKESHI KONDA, TSUBASA AOKI, TAKUMI UEDA, ET AL.

链接:

https://www.science.org/doi/10.1126/science.abd0966

摘要:

水通道蛋白的疏水性内表面促进了水在其中的超快渗透。聚四氟乙烯有着致密的氟面,因此具有很强的防水性。

研究组报道了一系列内径为0.9-1.9纳米的含氟低聚酰胺纳米环。这些纳米环在磷脂双层膜中进行超分子聚合,形成含氟纳米通道,其内壁被氟原子密集覆盖。直径最小的纳米通道的水渗透通量比水通道蛋白和碳纳米管的水渗透通量大两个数量级。

该研究所提出的纳米通道具有可忽略的氯离子(C l- )渗透性,这是由静电负氟内表面提供的强大静电屏障造成的。因此,这种纳米通道有望在脱盐过程中显示出近乎完美的阻盐。

Abstract:

Ultrafast water permeation in aquaporins is promoted by their hydrophobic interior surface. Polytetrafluoroethylene has a dense fluorine surface, leading to its strong water repellence. We report a series of fluorous oligoamide nanorings with interior diameters ranging from 0.9 to 1.9 nanometers. These nanorings undergo supramolecular polymerization in phospholipid bilayer membranes to form fluorous nanochannels, the interior walls of which are densely covered with fluorine atoms. The nanochannel with the smallest diameter exhibits a water permeation flux that is two orders of magnitude greater than those of aquaporins and carbon nanotubes. The proposed nanochannel exhibits negligible chloride ion (C l- ) permeability caused by a powerful electrostatic barrier provided by the electrostatically negative fluorous interior surface. Thus, this nanochannel is expected to show nearly perfect salt reflectance for desalination.


化学 Chemistry


Scalable processing for realizing 21.7%-efficient all-perovskite tandem solar moles

可扩展处理实现21.7%效率的全钙钛矿串联太阳能模块

作者:KE XIAO, YEN-HUNG LIN, MEI ZHANG, ROBERT D. J. OLIVER, XI WANG, ZHOU LIU, ET AL.

链接:

https://www.science.org/doi/10.1126/science.abn7696

摘要:

将全钙钛矿串联太阳能电池作为模块而非单结结构来制造面临诸多挑战,包括生长高质量的宽禁带钙钛矿,以及减缓互连触点处卤化物和金属互扩散造成的不可逆退化。

研究组展示了使用可扩展制造技术制备高效全钙钛矿串联太阳能模块。通过系统调节无甲基铵1.8eV混合卤化物钙钛矿的铯比,他们提升了大面积刀片涂层薄膜的结晶均匀性。

研究组在互连的子电池间引入导电共形“扩散势垒”,以提高全钙钛矿串联太阳能模块的功率转换效率(PCE)和稳定性。

该串联模块获得了21.7%的认证PCE,孔径面积为20 c m2 ,在模拟1-太阳光照下连续运行500小时后仍保持75%的初始效率。

Abstract:

Challenges in fabricating all-perovskite tandem solar cells as moles rather than as single-junction configurations include growing high-quality wide-bandgap perovskites and mitigating irreversible degradation caused by halide and metal interdiffusion at the interconnecting contacts. We demonstrate efficient all-perovskite tandem solar moles using scalable fabrication techniques. By systematically tuning the cesium ratio of a methylammonium-free 1.8–electron volt mixed-halide perovskite, we improve the homogeneity of crystallization for blade-coated films over large areas. An electrically conctive conformal “diffusion barrier” is introced between interconnecting subcells to improve the power conversion efficiency (PCE) and stability of all-perovskite tandem solar moles. Our tandem moles achieve a certified PCE of 21.7% with an aperture area of 20 square centimeters and retain 75% of their initial efficiency after 500 hours of continuous operation under simulated 1-sun illumination.


地球科学 Earth Science


High-resolution mapping of losses and gains of Earth’s tidal wetlands

全球潮汐湿地消长的高分辨率绘图

作者:NICHOLAS J. MURRAY, THOMAS A. WORTHINGTON, PETE BUNTING, STEPHANIE DUCE, VALERIE HAGGER, CATHERINE E. LOVELOCK, ET AL.

链接:

https://www.science.org/doi/10.1126/science.abm9583

摘要:

人们预期潮汐湿地会对全球环境变化做出动态响应,但湿地损失在多大程度上被湿地增加所抵消仍不清楚。

研究组对卫星数据进行了全球分析,以同时监测1999-2019年间三种高度互联的潮间生态系统类型——潮滩、潮沼和红树林的变化。

在全球范围内,13700 k m2 的潮汐湿地已经消失,但被9700 k m2 的湿地增加所抵消后,最终20年间净缩减4000 k m2 。

研究组发现,这些损失和增长中有27%与直接人类活动有关,例如转向农业和恢复失去的湿地。所有其他变化都归因于间接驱动因素,包括沿海过程和气候变化的影响。

Abstract:

Tidal wetlands are expected to respond dynamically to global environmental change, but the extent to which wetland losses have been offset by gains remains poorly understood. We developed a global analysis of satellite data to simultaneously monitor change in three highly interconnected intertidal ecosystem types—tidal flats, tidal marshes, and mangroves—from 1999 to 2019. Globally, 13,700 square kilometers of tidal wetlands have been lost, but these have been substantially offset by gains of 9700 k m2 , leading to a net change of 4000 k m2 over two decades. We found that 27% of these losses and gains were associated with direct human activities such as conversion to agriculture and restoration of lost wetlands. All other changes were attributed to indirect drivers, including the effects of coastal processes and climate change.

6. frp和ngrok哪个速度快

速度和你的服务器有关。ngrok设置太复杂,frp设置简单,稳定性: ngrok路由器端是c编译的,比较稳定。 frp是go语言的, 速度当然跟你的服务器有关。

7. chkds/p命令无法识别是什么原因

要先进到ngrok.cfg的路径下,在执行命令才行。
ngrok配置方法
1、下载ngrok源码
(GOPATH=~/goproj)
$ mkdir ~/goproj/src/github.com/inconshreveable
$ git clone https://github.com/inconshreveable/ngrok.git
$ export GOPATH=~/goproj/src/github.com/inconshreveable/ngrok
2、生成自签名证书
使用ngrok.com官方服务时,我们使用的是官方的SSL证书。自建ngrokd服务,我们需要生成自己的证书,并提供携带该证书的ngrok客户端。
证书生成过程需要一个NGROK_BASE_DOMAIN。 以ngrok官方随机生成的地址693c358d.ngrok.com为例,其NGROK_BASE_DOMAIN就是"ngrok.com",如果你要 提供服务的地址为"example.tunnel.tony.com",那NGROK_BASE_DOMAIN就应该 是"tunnel.tony.com"。
我们这里以NGROK_BASE_DOMAIN="tunnel.tony.com"为例,生成证书的命令如下:
$ cd ~/goproj/src/github.com/inconshreveable/ngrok
$ openssl genrsa -out rootCA.key 2048
$ openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=tunnel.tony.com" -days 5000 -out rootCA.pem
$ openssl genrsa -out device.key 2048
$ openssl req -new -key device.key -subj "/CN=tunnel.tony.com" -out device.csr
$ openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 5000
执行完以上命令,在ngrok目录下就会新生成6个文件:
-rw-rw-r– 1 ubuntu ubuntu 1001 Mar 14 02:22 device.crt
-rw-rw-r– 1 ubuntu ubuntu 903 Mar 14 02:22 device.csr
-rw-rw-r– 1 ubuntu ubuntu 1679 Mar 14 02:22 device.key
-rw-rw-r– 1 ubuntu ubuntu 1679 Mar 14 02:21 rootCA.key
-rw-rw-r– 1 ubuntu ubuntu 1119 Mar 14 02:21 rootCA.pem
-rw-rw-r– 1 ubuntu ubuntu 17 Mar 14 02:22 rootCA.srl
ngrok通过bindata将ngrok源码目录下的assets目录(资源文件)打包到可执行文件(ngrokd和ngrok)中 去,assets/client/tls和assets/server/tls下分别存放着用于ngrok和ngrokd的默认证书文件,我们需要将它们替换成我们自己生成的:(因此这一步务必放在编译可执行文件之前)
cp rootCA.pem assets/client/tls/ngrokroot.crt
cp device.crt assets/server/tls/snakeoil.crt
cp device.key assets/server/tls/snakeoil.key
3、编译ngrokd和ngrok
在ngrok目录下执行如下命令,编译ngrokd:
$ make release-server
不过在我的AWS上,出现如下错误:
GOOS="" GOARCH="" go get github.com/jteeuwen/go-bindata/go-bindata
bin/go-bindata -nomem -pkg=assets -tags=release \
-debug=false \
-o=src/ngrok/client/assets/assets_release.go \
assets/client/…
make: bin/go-bindata: Command not found
make: *** [client-assets] Error 127
go-bindata被安装到了$GOBIN下了,go编译器找不到了。修正方法是将$GOBIN/go-bindata拷贝到当前ngrok/bin下。
$ cp /home/ubuntu/.bin/go14/bin/go-bindata ./bin
再次执行make release-server。
~/goproj/src/github.com/inconshreveable/ngrok$ make release-server
bin/go-bindata -nomem -pkg=assets -tags=release \
-debug=false \
-o=src/ngrok/client/assets/assets_release.go \
assets/client/…
bin/go-bindata -nomem -pkg=assets -tags=release \
-debug=false \
-o=src/ngrok/server/assets/assets_release.go \
assets/server/…
go get -tags 'release' -d -v ngrok/…
code.google.com/p/log4go (download)
go: missing Mercurial command. See http://golang.org/s/gogetcmd
package code.google.com/p/log4go: exec: "hg": executable file not found in $PATH
github.com/gorilla/websocket (download)
github.com/inconshreveable/go-update (download)
github.com/kardianos/osext (download)
github.com/kr/binarydist (download)
github.com/inconshreveable/go-vhost (download)
github.com/inconshreveable/mousetrap (download)
github.com/nsf/termbox-go (download)
github.com/mattn/go-runewidth (download)
github.com/rcrowley/go-metrics (download)
Fetching https://gopkg.in/yaml.v1?go-get=1
Parsing meta tags from https://gopkg.in/yaml.v1?go-get=1 (status code 200)
get "gopkg.in/yaml.v1": found meta tag main.metaImport{Prefix:"gopkg.in/yaml.v1", VCS:"git", RepoRoot:"https://gopkg.in/yaml.v1"} at https://gopkg.in/yaml.v1?go-get=1
gopkg.in/yaml.v1 (download)
make: *** [deps] Error 1
又出错!提示找不到hg,原来是aws上没有安装hg。install hg后(sudo apt-get install mercurial),再编译。
$ make release-server
bin/go-bindata -nomem -pkg=assets -tags=release \
-debug=false \
-o=src/ngrok/client/assets/assets_release.go \
assets/client/…
bin/go-bindata -nomem -pkg=assets -tags=release \
-debug=false \
-o=src/ngrok/server/assets/assets_release.go \
assets/server/…
go get -tags 'release' -d -v ngrok/…
code.google.com/p/log4go (download)
go install -tags 'release' ngrok/main/ngrokd
同样编译ngrok:
$ make release-client
bin/go-bindata -nomem -pkg=assets -tags=release \
-debug=false \
-o=src/ngrok/client/assets/assets_release.go \
assets/client/…
bin/go-bindata -nomem -pkg=assets -tags=release \
-debug=false \
-o=src/ngrok/server/assets/assets_release.go \
assets/server/…
go get -tags 'release' -d -v ngrok/…
go install -tags 'release' ngrok/main/ngrok
AWS上ngrokd和ngrok被安装到了$GOBIN下。
三、调试
1、启动ngrokd
$ ngrokd -domain="tunnel.tony.com" -httpAddr=":8080" -httpsAddr=":8081"
[03/14/15 04:47:24] [INFO] [registry] [tun] No affinity cache specified
[03/14/15 04:47:24] [INFO] [metrics] Reporting every 30 seconds
[03/14/15 04:47:24] [INFO] Listening for public http connections on [::]:8080
[03/14/15 04:47:24] [INFO] Listening for public https connections on [::]:8081
[03/14/15 04:47:24] [INFO] Listening for control and proxy connections on [::]:4443

8. 如何在windows环境下编译ngrok

1、安装google go
2、安装git
3、安装Mingw
4、把go的bin目录添加到PATH环境变量,可以直接在CMD中执行
SET PATH=%PATH%;C:\go\bin
5、把mingw的bin目录添加到PATH路径
SET PATH=%PATH%;C:\go\bin
6、下载ngrok源码,
7、将下载的zip解压出来,修改Makefile
将 export GOPATH:=$(shell pwd)
改为 export GOPATH:=C:\Users\Administrator\Desktop\ngork\ngrok-src
将 bin/go-bindata:
GOOS="" GOARCH="" go get github.com/jteeuwen/go-bindata/go-bindata
这段改为 bin/go-bindata:
GOOS=windows GOARCH=amd64 go get github.com/jteeuwen/go-bindata/go-bindata
8、修改log4go的路径
修改src\ngrok\log\logger.go中log4o那段代码为
log "github.com/keepeye/log4go"
9、cmd执行
make release-all

热点内容
苹果像素低为什么比安卓好 发布:2025-05-14 19:13:23 浏览:459
安卓机微信怎么设置红包提醒 发布:2025-05-14 19:00:15 浏览:271
androidsystem权限设置 发布:2025-05-14 18:56:02 浏览:970
mq脚本 发布:2025-05-14 18:45:37 浏览:25
仙境传说ro解压失败 发布:2025-05-14 18:45:01 浏览:868
betweenand的用法sql 发布:2025-05-14 18:39:25 浏览:250
tplink摄像头存储卡格式化 发布:2025-05-14 18:37:08 浏览:347
安卓平板怎么安装excel的软件 发布:2025-05-14 18:35:44 浏览:42
广州数控圆弧编程实例 发布:2025-05-14 18:25:00 浏览:401
搭建服务器能使用nodejs开发吗 发布:2025-05-14 18:24:14 浏览:136