vzex / dog-tunnel Goto Github PK
View Code? Open in Web Editor NEWp2p tunnel,(udp mode work with kcp,https://github.com/skywind3000/kcp)
Home Page: https://github.com/vzex/dog-tunnel
License: MIT License
p2p tunnel,(udp mode work with kcp,https://github.com/skywind3000/kcp)
Home Page: https://github.com/vzex/dog-tunnel
License: MIT License
前几天用的还好好的, 今天出这个错误了
服务器:45.1.1.1, 远端:27.1.1.1, 近端:114.1.1.1
看起来都连上服务器了, 然后打洞没成功?
服务器log
# ./dtunnel_s -addr=0.0.0.0:20730
2016/10/16 09:51:02 listenAdd: 0.0.0.0:8018
2016/10/16 09:51:02 master start success
2016/10/16 09:51:04 client linked success 27.1.1.1:50046
2016/10/16 09:51:04 client reg service success 27.1.1.1:50046 x220
2016/10/16 09:51:40 client linked success 114.1.1.1:50551
2016/10/16 09:51:40 client link service success 114.1.1.1:50551 x220
2016/10/16 09:51:40 start session 1 0 x220 1
2016/10/16 09:51:40 ===>>tell a to report addrlist 114.1.1.1:50551 x220 1
2016/10/16 09:51:51 remove client session 1
2016/10/16 09:51:51 send quit
2016/10/16 09:51:51 client disconnected 114.1.1.1:50551
2016/10/16 09:51:51 session loop quit 1
2016/10/16 09:53:50 timeout,remove udpsession 1
远端log:
./dtunnel -reg=x220 -remote=45.1.1.1:20730 -local=:20731 -ssl=false
connect to server succeed
2016-10-16 09:51:04 register service ok, user:
近端log:
dtunnel.exe -link=x220 -remote=45.1.1.1:20730 -local=:20731 -ssl=false
connect to server succeed
Can't resolve udp address: lookup dog-tunnel.tk: getaddrinfow: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server.
init error lookup dog-tunnel.tk: getaddrinfow: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server.
read tcp 192.168.1.3:50551->45.1.1.1:20730: use of closed network connection
能否吧KCP单独提出来一个kcp-go库独立维护.
socks5 代理模式试图访问 ipv6 域名,无法访问,不支持 ipv6?
你好,因学校无公网IP环境,为连接到学校网络,我在内网中建了个VPN服务器做鉴权(要多人使用),但打洞成功后却无法转发到内网的VPN服务器,怎么破呢
client cannot enter p2p mode when the other side client even has a public IP
dog-tunnel非常好用,本人用它做游戏加速使用的。
但是在高峰时期,平时很好的日本网络也会丢包(ping 服务器ip也会丢包),估计是骨干网络带宽跑满了。
最近在使用kcp-tun,可惜只能转发tcp流量。但是它两点特性是非常好的:
1。数据压缩
2. 前向纠错。 (好像这个特性可以允许基础数据包丢失20%仍然能 完整传输,换言说能允许20%的丢包?)
反正在公司的海外项目上使用KCP-TUN,在比较容易抖动的香港到大陆的传输过程,显得比较稳定。
dog-tunnel可以在客户端这里随意变换参数去连接,这点是比较赞的。
你好,断网重新连接后提示服务已存在。
例如我注册一个远端,名字为myName,注册成功并且监听,当远端所在的机器发生网络中断,比如adsl重新拨号、网卡禁用再启用等情况,虽然远端10秒后会自动尝试连接服务器,但是此时却提示服务名已存在,即使关掉进程重新打开也是一样,也就是说服务器不能将异常断开的服务删除,除非用管理接口删除,或重启服务器进程,这对于无人值守的内网用户来说非常不方便,请问可以解决这个BUG吗,或者有什么解决方法?下面是我在远端机器禁用网卡再启用网卡后的狗洞的输出信息:
C:\Users\Administrator\Desktop\dtunnel>dtunnel.exe -reg m
yname1 -local localhost:7899 -clientkey 123456
connect to server succeed
2016-11-23 07:47:38 register service ok, user:
read tcp 192.168.1.186:49260->65.181.125.112:8000: wsarecv: An existing connecti
on was forcibly closed by the remote host.
connect remote err:dial tcp: lookup dog-tunnel.tk: getaddrinfow: No such host is
known.
connect remote err:dial tcp: lookup dog-tunnel.tk: getaddrinfow: No such host is
known.
connect remote err:dial tcp: lookup dog-tunnel.tk: getaddrinfow: No such host is
known.
connect to server succeed
2016-11-23 07:48:34 already have the ServerName!
read tcp 192.168.1.186:49261->65.181.125.112:8000: use of closed network connect
ion
connect to server succeed
2016-11-23 07:48:46 already have the ServerName!
read tcp 192.168.1.186:49262->65.181.125.112:8000: use of closed network connect
ion
connect to server succeed
2016-11-23 07:48:57 already have the ServerName!
read tcp 192.168.1.186:49263->65.181.125.112:8000: use of closed network connect
ion
connect to server succeed
2016-11-23 07:49:08 already have the ServerName!
read tcp 192.168.1.186:49266->65.181.125.112:8000: use of closed network connect
ion
设 ./dtunnel_s -ssl=true -cert=server.crt key=server.key
一直提示load key file error open : no such file or directory
我目录下有这2个文件的
如题
Hi do you will support DNS?
2015/01/14 08:01:40 init client {"AccessKey":"","ClientKey":"***************","Name":"************","ClientType":"link","Version":0.6,"Delay":2,"Mode":0,"PipeNum":1,"AesKey":""}
2015-01-14 08:01:40 serverName invalid!!!
use of closed network connection
2015/01/14 08:01:40 service shutdown
ServerName invalid error
QoS support enhanced.
Currently no QoS support. Multiple connections not working very well.
开着 OneDrive 同步文件,网络是 OneDrive->proxifier->dtunnel_lite
OneDrive 大概10个tcp连接同步文件,流量总计400-500k。
这时候 chrome shcks5 -> dtunnel_lite 就近乎无法打开网页了,卡在等待响应状态,最后变成“ERR_TIMED_OUT”错误界面。
例如 http://www.ipip.net/ 打不开,加 -v 参数可以看到如下日志:
2015/08/29 14:42:58 tcp www.ipip.net:80 3 80
关闭 OneDrive 不同步文件时,打开 http://www.speedtest.net/ 测速能达到 2M-3M 的速度。
The latest master branch can not working
Process hang on After show message
connect to server succeed
connect to server succeed
connect to server succeed
connect to server succeed
connect to server succeed
connect to server succeed
connect to server succeed
connect to server succeed
connect to server succeed
connect to server succeed
connect to server succeed
connect to server succeed
connect to server succeed
connect to server succeed
这样,服务器资源不会负载太大。
如提,压缩在大部分情况下有利于减少网络流量 Snappy数据流压缩 ,或gzip 或 lz4
lite 假如开启了 -cache 缓存,文件缓存时间是不是永久的?
如果是永久的,缓存是不是必须手动清理?
如果不是永久的,缓存时间是怎么定义的?
WSARecvFrom udp [::]:49656: use of closed network connection.
客户端proxifier+dtun-lite,win7 64bit
dtunnel_lite.exe -servicexxxx:20000 -action socks5 -local :1090
服务端,ubuntu 14.0
./dtunnel_lite -service 0.0.0.0:20000 -action ""
游戏登录后有2个tcp长连接,一个负责聊天系统,一个负责游戏场景
首次登录没有问题,但是当发生换线或者换角色时,游戏场景tcp连接会断开重新连接另一台服务器
用了dtun之后该连接断开后就没有再连接了,游戏也就卡住了。
目前尝试过的操作:
添加或删除xor,encrypt,auth,pipe
sock5代理,端口映射(通过shadowsocks,直连ss并无问题)
1client <-> 1client :ok
1client <-> multi client : the server side may cause dead lock!
connect remote err:dial tcp 65.181.125.112:8018: connection refused
首先感谢dog-tunnel的作者。我第一时间把最新的dog-tunnel的源码拿出来编译,以体验 新增的commpress、fec模式。下面是我几点的疑问:
1。看到最新的提交,commpress、fec模式只能用于UDP模式?
2。commpress模式说明里面说两端都要指定,但是在参数那里写了一个“c"; 在fec模式也是客户端指定就可以了?
3。本人远端的服务器是日本的。使用tcp模式转发vpn流量时ping值最接近原始服务器ping值;使用UDP模式时ping值明显增加50ms~70ms,fec模式抖动就比较明显,低的时候很低,高的时候特别高。有时瞬时值600ms~1000ms。 下面是延迟比较:TCP(commpress、fec)< UDP (commpress、encrypt)<UDP (commpress、ds10 -ps3) < (commpress、ds5 -ps5)
4.好像KCP可以调参数的?手动调参数觉得有点繁琐,如果能像KCPtun 那样有normal、fast、fast2、fast3这种傻瓜选项就好了。
另外反馈一下,开了fec模式模式之后,下载速度可以跑满本地带宽,真不错。看了服务器带宽使用比本地还要大,哈哈。
比如说:
我直接运行: ./dtunnel_s
那么远端和近端通过连接到自建公网 IP 的服务器就行了吗?
我测试的时候发现:
客户端可以连接到自建服务器,但是两端的话没通,近端没显示 service start success 。
[UDPVersion] Connection freeze, kill and restart fixed it.
After a while no activty, dog tunnel will freeze, and dead.
As this point, may dog tunnel choose exit process?
I am using systemd watching the dog tunnel process, if process exited. the sytemd will restart dog tunnel
Document need improvement
远端、近段都是win系统,
远端:dtunnel -reg zzcs -local :88 -ssl false
远端这个88访问是没问题的,web server,近端可以直接 http://192.168.1.10:88/ 访问。
近端: dtunnel -link zzcs -local :8888 -ssl false
近端的错误是:cannot connect to bind addr:88
连接方式显示p2p, 另外加参数 -mode 2 ,仍旧显示p2p模式
kcp的参数配置有可能开放给用户吗?简单的几个模式或者是具体的配置
另外除了命令行配置外提供文件配置可能吗?
cannot listen addr:listen tcp: too many colons in address udp:127.0.0.1:8080
Do you accept donation?
p2p模式和c/s模式有什么区别。我发现c/s模式也没有走服务器流量
开了个ssh端口
刚开始能连, 一段时间不用再开ssh 就连不上了. 看log 还是在 service start success,please connect :2222 p2p mode
的状态.
关了dtunnel 重新再开倒是可以连
server端,远端 都是win系统
server端直接exe运行,阿里云服务器,如IP是:219.235.1.203
远端:dtunnel -reg a -remote 219.235.1.203:8000 -local :88 -ssl false
远端隔几秒就显示一行: connect remote err:EOF
近端:没试
好像dog-tunnel p2p版默认只能映射tcp端口的,不知道UDP端口应该如何映射?
谢谢
这个工具可以解决我们小开发团队内网穿透的问题,非常感谢vzex。另外,想请问一下lite版本是否会开源?
How about like this:
Dog tunnel provide a P2P tunnel between your any two network, via UDP protocol on top of KCP.
It's amazing fast and stable , gain better performance than other tunnel solution.
It's written with pure golang by vzex.
请问如何搭建自己的狗洞服务器呢,也是用udp端口吗。
两个不同局域网的内网节点之间通过STUN协议是不是能保证一定连通?如果不保证,是不是应该用TURN做补充,或者用ICE?谢谢!
2015/08/29 13:17:29 try dial xxx.com:port ok 0 [::]:60996
2015/08/29 13:17:29 request auth key 148156
2015/08/29 13:17:29 request encrypt
2015/08/29 13:17:29 debug aeskey 115861556875
2015/08/29 13:17:29 server force do action socks5
client service start success,please connect :88
2015/08/29 13:17:37 Request Message VER or RSV error!
2015/08/29 13:18:12 Request Message VER or RSV error!
想通过 dtunnel_lite 做个安全隧道将服务器的内部服务映射到本地,方便本地使用,看起来是不支持?
github 上的源码编出来的是 server端和client端的,没看到有生成 lite
all:
@make release
release:
make client
make server
debug:
make client_debug
make server_debug
client_debug:
@go build -gcflags "-N -l" -o dtunnel_d client.go
server_debug:
@go build -gcflags "-N -l" -o dtunnel_s_d server.go
client:
@go build -ldflags "-s -w" -o dtunnel client.go
server:
@go build -ldflags "-s -w" -o dtunnel_s server.go
clean:
@rm -rf dtunnel dtunnel_d dtunnel_s_d dtunnel_s
.PHONY: all debug release client_debug server_debug client server clean
makefile里面没有看到lite,谢谢
我希望在路由器中使用,相信这个需求量应该不少。
你好
是否可以考虑通过比如压缩数据包, 批量发送的方式来提高传输的效率?
谢谢。
What's the license type of dog-tunnel?
Is it opensource project?
GPL ? MIT ? New BSD ? Apache?
If you have no idea, MIT license will be fine.
Master branch, dtunnel will became freeze after a while
or if a few minutes non active , the session will dead.
这个部分是开源的还是?
Can we just using the C/S mode ? (Do not need connect to your server)
i just want to make hole between my client and server , I know my server ip, so i only want to make hole to my server.
client <===> server
this is enough for me .
Docker images for dog-tunnel lite version (TCP protocol)
https://registry.hub.docker.com/u/netroby/dogserver/
Run as root on your vps or cloud computing machine. (well tested on CoreOS)
docker pull netroby/dogserver && docker run --name="prod_dogserver" -i -t -p 18080:18080 -p 18081:18081 -p 18082:18082 netroby/dogserver /bin/bash
the auto start script is location at /root/doghole.sh
you may want to change the authkey
and please note we using docker , and we using tcp protocol
and at your client side, you need to connect via tcp protocol
A scripts for client side
#!/bin/sh
cd $HOME
SIP="this.is.your.serverip"
killall -9 dtunnel_lite && sleep 2
dtunnel_lite -tcp -service $SIP:18080 -local :7070 -auth helloworld &
dtunnel_lite -tcp -service $SIP:18081 -local :7071 -auth helloworld &
dtunnel_lite -tcp -service $SIP:18082 -local :7072 -auth helloworld &
The p2p punch hole workflow will be rewritten in a few days. meanwhile, the udp-pipe flow control from dtunnel_lite will be merged into dtunnel.
如题
两台机器都在内网,没有独立IP,感觉还是需要服务器中转,因为两台机器连上了后下载只有个位数KB
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.