同步操作将从 小众镜像/ngrok-c 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
不会编译的伙伴可以用,hauntek大神写的python版本,https://github.com/hauntek/python-ngrok
ddns.cpp and https.cpp are abandoned
run Build.bat in CLI.
run build.sh instead of makefile
run openwrtbuild.sh
cp Makefile.openssl.static Makefile
make
Compile and install mbedTLS into tomatoware first, then:
cp Makefile.mbedtls.static Makefile
make
命令
ngrok-polarssl -SER[Shost:ngrokd.ngrok.com,Sport:443,Atoken:xxx] -AddTun[Type:http,Lhost:127.0.0.1,Lport:80,Sdname:xxdosgo]
Shost -Server host. //服务器host
Sport -server port. //服务器端口
Atoken -ngrok authtoken. //服务器认证串
type -tcp or http or https. //要映射的类型,tcp,http,https
Lhost -local address. //本地地址,如果是本机直接127.0.0.1
Lport -local port. //本地端口
sdname -Subdomain. //子域名
Hostname -hostname //自定义域名映射
Rport -remote port //远程端口,tcp映射的时候,制定端口使用。
You can also register multiple Tunnel, but can only have one of each type.
ngrokc.exe -SER[Shost:tunnel.mobi,Sport:44433] -AddTun[Type:http,Lhost:127.0.0.1,Lport:80,Hostname:xx.xxx.org] -AddTun[Type:tcp,Lhost:127.0.0.1,Lport:80,Rport:55556]
有空的话增加openssl的支持
感谢981213的makefile文件
感谢maz-1 修复ubuntu下编译bug
如果你使用的PolarSSL 版本是v2.0.0及其以上的版本编译,请把config.h文件的define ISMBEDTLS 改为1
-1.25 版本(测试)增加多个通道功能,避免多个进程,可以注册N个通道,如- ngrokc -AddTun[Type:http,Lhost:127.0.0.1,Lport:80,Sdname:Example] -AddTun[Type:http,Lhost:127.0.0.1,Lport:80,Sdname:Example1] -AddTun[Type:http,Lhost:127.0.0.1,Lport:80,Sdname:Example2]
-1.32稳定版本,修复1.25版本tcp映射出错问题。修复1.25的崩溃bug。
-1.33版本 修复重连子域名bug。
-1.37版本 修复一个崩溃bug,建议所有的都升级到这个版本。
-1.39版本 为了增加自定义cid。其它没用
-1.40版本 增加password功能支持。
准备新功能开发,UDP端口映射功能,有没有有兴趣的,一起开发,目前最大的问题在于,我的go语言很烂,别指望官方会加这功能,自己自己动手,又兴趣的加群192182463(QQ群)
-1.41版本 修复一个网络不好可能导致的内存泄漏问题。
-1.45版本 增加自定义转发Hostheader功能。用于那些本地会判断host的网站 使用方法-AddTun[Type:http,Lhost:127.0.0.1,Lport:80,Hostheader:localhost]
-1.53 add support openssl 1.1。
-1.54 add support http basic auth。 Example -AddTun[Type:http,Lhost:127.0.0.1,Lport:80,Httpauth:"test:test"]
-1.54 add support http basic auth。 Example -AddTun[Type:http,Lhost:127.0.0.1,Lport:80,Httpauth:"test:test"]
-1.55 add support local tls。 Example -AddTun[Type:https,Lhost:127.0.0.1,Lport:443,Ltls:1]
1.openssl版本
2.polarssl版本 - 把下载的polarssl里面的include/polarssl,或者include/mbedtls 文件夹复制到,你SDK里面的staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/include里面,(可能根据SDK路径有所不同)。 - 然后把第二步生成的,2.0版本(libmbedtls.a libmbedcrypto.a libmbedx5.9.a)1.3版本(libpolarssl.a)放到ngrok-c目录。 - 再修改,ngrok-c里面的config.h,#define OPENSSL 1,改成#define OPENSSL 0,如你的是2.0版本,请ISMBEDTLS 0改成ISMBEDTLS 1,如果是1.3,ISMBEDTLS 0 - 继续修改openwrtbuild.sh文件export STAGING_DIR export PATH,把里面的路径改成你下载的SDK,所在的目录,注意是staging_dir目录对应STAGING_DIR,bin目录对应PATH。 - 还有,最后一行的libpolarssl-mips.a改成2.0版本(libmbedtls.a libmbedcrypto.a libmbedx5.9.a)1.3版本(libpolarssl.a). - 执行openwrtbuild.sh,就行了。。 - 就会在build-mips生成ngrokc文件。。你用ssh,上传到路由的/bin目录,并且加入执行权限。。就可以了。。跑了。。
3.这里用Centos7 编译斐讯K2路由(polarssl库)做个(纯小白)教程
###安装相应软件包
yum install bzip2 gzip git vim wget -y
###下载并解压SDK(以下没说明的话均默认在/root目录下操作)
wget http://archive.openwrt.org/chaos_calmer/15.05/ramips/mt7621/OpenWrt-SDK-15.05-ramips-mt7621_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2
tar jxvf OpenWrt-SDK-15.05.1-ramips-mt7621_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2
###文件夹名字太长,改个名字....
mv OpenWrt-SDK-15.05.1-ramips-mt7621_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64 op
###拉取ngrok源码
git clone https://github.com/dosgo/ngrok-c.git
###开始编译polarsshl库###
###下载并解压polarssl
wget https://tls.mbed.org/download/mbedtls-2.14.1-gpl.tgz&&tar zxvf mbedtls-2.14.1-gpl.tgz
###复制buildlib.sh文件到polarssl文件夹
cp /root/ngrok-c/buildlib.sh /root/mbedtls-2.14.1/buildlib.sh
###修改buildlib.sh
vim /root/mbedtls-2.14.1/buildlib.sh
###我这里SDK是这个所以把PATH改成这个
###export PATH=$PATH:'/root/op/staging_dir/toolchain-mipsel_1004kc+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin'
###export STAGING_DIR="/root/op/staging_dir"
###下面的SDK编译器名字可以在SDK/bin 下找到,例如:
### ls /root/op/staging_dir/toolchain-mipsel_1004kc+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin
###看到一些gcc和g++之类的,把名字复制替换掉就行了
###运行buildlib.sh
cd /root/mbedtls-2.14.1&&chmod 777 buildlib.sh&&./buildlib.sh
###不出意外的话会在library文件夹生成三个文件libmbedcrypto.a,libmbedtls.a,libmbedx509.a
###把生成的文件复制到ngrok目录下
cd /root/mbedtls-2.14.1/library
cp {libmbedcrypto.a,libmbedtls.a,libmbedx509.a} /root/ngrok-c/
###复制mbedtls文件夹到SDK/include下
cp -r /root/mbedtls-2.14.1/include/mbedtls /root/op/staging_dir/toolchain-mipsel_1004kc+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/include/
###修改config.h文件,我们用的是polarssl2.0 所以把 #define OPENSSL 1,改成#define OPENSSL 0;#define ISMBEDTLS 0改成#define ISMBEDTLS 1(其实默认就是1.....)
vim /root/ngrok-c/config.h
###修改openwrtbuild.sh里面 SDK路径和编译器,SDK路径上边说了就不再重复,这里的编译器改成上面编译polarssh时buildlib.sh里的那个CXX的值
###我这里是CXX=mipsel-openwrt-linux-g++,所以openwrtbuild.sh的CC=mipsel-openwrt-linux-g++
vim /root/ngrok-c/openwrtbuild.sh
###修改CC=mipsel-openwrt-linux-g++,保存退出
cd /root/ngrok-c/
chmod 777 openwrtbuild.sh&&./openwrtbuild.sh
###执行完openwrtbuild.sh如果没有提示erroe的话就行了。。。
###然后会在build-mips生成ngrokc文件。。你用ssh,上传到路由的/bin目录,并且加入执行权限
###下面在SSH连接到路由后的操作
###记得安装,libstdcpp.ipk,官网有下载,我这个SDK对应的下载地址是
wget http://archive.openwrt.org/chaos_calmer/15.05/ramips/mt7621/packages/base/libstdcpp_4.8-linaro-1_ramips_1004kc.ipk
###安装
opkg install libstdcpp_4.8-linaro-1_ramips_1004kc.ipk
安装完就可以用了。。。。。
(小声BB:作者很有耐心,纯小白问一下很愚蠢的问题他都会耐心解答,哈哈,再次感谢dosgo)
1. 去http://downloads.openwrt.org/下载你路由对应的SDK版本 ,如OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2.tar.bz2,并且解压。
2.编辑openwrtbuildv2.sh 修改export STAGING_DIR export PATH,把里面的路径改成你下载的SDK。
3. 把openssl.zip解压到你的下载的sdk,/xxx/OpenWrt-SDK/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/include目录下,
4. 运行编辑openwrtbuildv2.sh,就会在build-mips生成一个叫ngrokc的文件。成功了。。把它复制到bin目录。就可以运行ngrokc了。
5.记得安装,libopenssl.ipk,官网有下载。
1. 去https://ziglang.org/download/下载zig编译器并且安装好,
2. 修改crossbuild.bat文件的TARGET=mipsel-linux-musl改成你的平台。
3. 运行crossbuild.bat就会在当前目录生成编译文件。
4. 记得安装,libopenssl.ipk,官网有下载。
编译就这样了,以后请不要邮件问我怎么编译了,有bug可以联系。
现在tunnel.mobi不能用了。。,哪里还有国内的服务器的。。
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。