1 Star 0 Fork 1

liuzy88 / p2p

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

P2P Test for JAVA

  • JAVA版TCP打洞NET穿透

SERVER

  • 有外网IP的服务器
  • 执行控制台程序java -jar p2p.jar
  • 输入listen <port>
******** P2P Test for JAVA ********
listen 7878
The server is now ready on port 7878.
Client 183.192.21.10:15268 connected.
Client 183.192.21.10:15268 msg: hello
Client 183.192.21.10:15334 connected.
183.192.21.10:15268 want p2p 183.192.21.10:15334
Send "p2p>>183.192.21.10:15334" to 183.192.21.10:15268
Send "p2p>>183.192.21.10:15268" to 183.192.21.10:15334
The client 183.192.21.10:15334 exit. because Connection reset

CLIENT A

  • 用户电脑A
  • 执行控制台程序java -jar p2p.jar
  • 输入conn <ip>:<port>
******** P2P Test for JAVA ********
conn 106.14.182.162:7878
Connect success.
hello
Send success.
pull
Received 2 records.
view
[x] 183.192.21.10:15268  <- is own.
[1] 183.192.21.10:15334
p2p 1
P2p 183.192.21.10:15334 connecting...
P2p connect success.
ni hao
P2p Send success.
he he da
P2p Send success.
quit

CLIENT B

  • 用户电脑B
  • 执行控制台程序java -jar p2p.jar
  • 输入conn <ip>:<port>
******** P2P Test for JAVA ********
conn 106.14.182.162:7878
Connect success.
show
My local is 192.168.1.7:57836, I am 183.192.21.10:15334 on server.
P2p 183.192.21.10:15268 connecting...
P2p connect success.
P2p msg: ni hao
P2p msg: he he da
P2p connect quit.
The MIT License (MIT) Copyright (c) 2018 刘仲阳 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

P2P Test for JAVA 展开 收起
Java
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/liuzy1988/p2p.git
git@gitee.com:liuzy1988/p2p.git
liuzy1988
p2p
p2p
master

搜索帮助