當前位置:首頁 » 編程軟體 » 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

熱點內容
java服務端緩存 發布:2025-05-14 15:53:37 瀏覽:105
php判斷postget 發布:2025-05-14 15:34:24 瀏覽:357
linux查看電腦配置 發布:2025-05-14 15:32:07 瀏覽:317
軍用壓縮水 發布:2025-05-14 15:27:19 瀏覽:26
win7c盤加密 發布:2025-05-14 15:04:49 瀏覽:511
dm碼編程 發布:2025-05-14 15:03:56 瀏覽:405
apache加密 發布:2025-05-14 14:49:13 瀏覽:970
安卓什麼軟體蘋果不能用 發布:2025-05-14 14:49:03 瀏覽:772
jsoupjava 發布:2025-05-14 14:38:00 瀏覽:889
影豹選哪個配置最好 發布:2025-05-14 14:28:50 瀏覽:256