0 Star 0 Fork 0

chiron / ngrok

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

Docker

docker build -t chiron/ngrok . 
docker run -it -v /home/object/ngrok:/ngrok chiron/ngrok /bin/sh
docker run -it -v /Users/chiron/Object/ngrok:/ngrok chiron/ngrok /bin/sh
# docker run -it -p 801:80 -p 4431:443 -p 4432:4432 -v /home/object/ngrok:/ngrok -d chiron/ngrok /ngrok/bin/ngrokd -domain="brahm.cn" -httpAddr=":801" -httpsAddr=":443" -tunnelAddr=":4432"
server_addr: "chiron.wang:4432"

./ngrok -config=ngrok.conf -subdomain obj3 80

cd到ngrok目录

设置证书 NGROK_DOMAIN="chiron.com" openssl genrsa -out rootCA.key 2048 openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=$NGROK_DOMAIN" -days 5000 -out rootCA.pem openssl genrsa -out device.key 2048 openssl req -new -key device.key -subj "/CN=$NGROK_DOMAIN" -out device.csr openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 5000

将新生成的证书,替换掉assets/client/tls下的证书 cp -f rootCA.pem assets/client/tls/ngrokroot.crt cp -f device.crt assets/server/tls/snakeoil.crt cp -f device.key assets/server/tls/snakeoil.key

编译 服务端和客户端 make release-server GOOS=windows GOARCH=386 make release-client GOOS=windows GOARCH=amd64 make release-client

raspberry pi

GOOS=linux GOARCH=arm make release-client

cd /home/ngrok/ nohup bin/ngrokd -tlsKey=device.key -tlsCrt=device.crt -domain="chiron.com" -httpAddr=":801" -httpsAddr=":4431" -tunnelAddr=":44431"&

0 * * * * root ps -ef| grep -v grep | grep ngrokd;if [ $? -ne 0 ]; then cd /home/ngrok/;nohup bin/ngrokd -tlsKey=device.key -tlsCrt=device.crt -domain="chiron.com" -httpAddr=":801" -httpsAddr=":4431" -tunnelAddr=":44431" >/dev/null 2>&1 & fi

ngrok --config ngrok.conf 80

#修改服务器打开文件数限制

#查看 ulimit -n ulimit -a

vi /etc/security/limits.conf #最后添加

  • soft nofile 10240
  • hard nofile 10240 hive - nofile 10240 hive - nproc 10240

#用户进程限制

vi /etc/security/limits.d/20-nproc.conf #加大普通用户限制 也可以改为unlimited

  •      soft    nproc     40960

root soft nproc unlimited #此步骤需要重启机器生效,可以设置完后再重启

//设定权限 chmod a+x

http://blog.csdn.net/u010887744/article/details/53957683

//关闭防火墙 systemctl stop iptables.service systemctl disable iptables.service

Copyright 2013 Alan Shreve Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

暂无描述 展开 收起
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/hades_c/ngrok.git
git@gitee.com:hades_c/ngrok.git
hades_c
ngrok
ngrok
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891