Skip to content

Commit 1044d5a

Browse files
authored
Update README.md
1 parent e503ed3 commit 1044d5a

File tree

1 file changed

+34
-91
lines changed

1 file changed

+34
-91
lines changed

README.md

Lines changed: 34 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,34 @@
1-
# tinyPortMapper (or tinyPortForwarder)
2-
A Lightweight High-Performance Port Mapping/Forwarding Utility using epoll, Supports both TCP and UDP
3-
4-
# Supported Platforms
5-
Linux host (including desktop Linux,Android phone/tablet, OpenWRT router, or Raspberry PI). Binaries of `amd64` `x86` `mips_be` `mips_le` `arm` are provided.
6-
7-
# Getting Started
8-
9-
### Installing
10-
11-
Download binary release from https://github.com/wangyu-/tinyPortMapper/releases
12-
13-
### Running
14-
Assume you want to map/forward local port 1234 to 10.222.2.1:443
15-
```
16-
# for both TCP and UDP
17-
./tinymapper_amd64 -l0.0.0.0:1234 -r10.222.2.1:443 -t -u
18-
19-
# for TCP only
20-
./tinymapper_amd64 -l0.0.0.0:1234 -r10.222.2.1:443 -t
21-
22-
# for UDP only
23-
./tinymapper_amd64 -l0.0.0.0:1234 -r10.222.2.1:443 -u
24-
25-
# for ipv6, both TCP and UDP
26-
# ipv6 address must be surrounded with `[]`, ipv4 address must NOT be surrounded with `[]`
27-
./tinymapper_amd64 -l[::]:1234 -r[2001:19f0:7001:1111:00:ff:11:22]:443 -t -u
28-
```
29-
30-
##### NOTE
31-
```
32-
# local port and remote port can be the same
33-
./tinymapper_amd64 -l0.0.0.0:443 -r10.222.2.1:443 -u
34-
35-
# you can also use 6-to-4 or 4-to-6 forward
36-
./tinymapper_amd64 -l0.0.0.0:1234 -r[2001:19f0:7001:1111:00:ff:11:22]:443 -t -u
37-
./tinymapper_amd64 -l[::]:1234 -r44.55.66.77:443 -t -u
38-
39-
# you can also use ipv4-mapped ipv6 address
40-
# this is especially useful if you want to play with ipv6 and you dont have a real ipv6 address
41-
./tinymapper_amd64 -l[::]:4433 -r[::ffff:10.222.2.1]:443 -t -u
42-
./tinymapper_amd64 -l[::ffff:0.0.0.0]:4433 -r[::ffff:10.222.2.1]:443 -t -u
43-
```
44-
# Options
45-
```
46-
tinyPortMapper
47-
git version:25ea4ec047 build date:Nov 4 2017 22:55:23
48-
repository: https://github.com/wangyu-/tinyPortMapper
49-
50-
usage:
51-
./this_program -l <listen_ip>:<listen_port> -r <remote_ip>:<remote_port> [options]
52-
53-
main options:
54-
-t enable TCP forwarding/mapping
55-
-u enable UDP forwarding/mapping
56-
57-
other options:
58-
--sock-buf <number> buf size for socket, >=10 and <=10240, unit: kbyte, default: 1024
59-
--log-level <number> 0: never 1: fatal 2: error 3: warn
60-
4: info (default) 5: debug 6: trace
61-
--log-position enable file name, function name, line number in log
62-
--disable-color disable log color
63-
-h,--help print this help message
64-
```
65-
66-
# Peformance Test
67-
```
68-
root@debian9:~# iperf3 -c 127.0.0.1 -p5202
69-
Connecting to host 127.0.0.1, port 5202
70-
[ 4] local 127.0.0.1 port 37604 connected to 127.0.0.1 port 5202
71-
[ ID] Interval Transfer Bandwidth Retr Cwnd
72-
[ 4] 0.00-1.00 sec 696 MBytes 5.84 Gbits/sec 0 639 KBytes
73-
[ 4] 1.00-2.00 sec 854 MBytes 7.17 Gbits/sec 0 639 KBytes
74-
[ 4] 2.00-3.00 sec 727 MBytes 6.10 Gbits/sec 0 639 KBytes
75-
[ 4] 3.00-4.00 sec 670 MBytes 5.62 Gbits/sec 0 639 KBytes
76-
[ 4] 4.00-5.00 sec 644 MBytes 5.40 Gbits/sec 0 639 KBytes
77-
[ 4] 5.00-6.00 sec 957 MBytes 8.03 Gbits/sec 0 639 KBytes
78-
[ 4] 6.00-7.00 sec 738 MBytes 6.19 Gbits/sec 0 639 KBytes
79-
[ 4] 7.00-8.00 sec 714 MBytes 5.99 Gbits/sec 0 639 KBytes
80-
[ 4] 8.00-9.00 sec 817 MBytes 6.85 Gbits/sec 0 639 KBytes
81-
[ 4] 9.00-10.00 sec 619 MBytes 5.19 Gbits/sec 0 639 KBytes
82-
- - - - - - - - - - - - - - - - - - - - - - - - -
83-
[ ID] Interval Transfer Bandwidth Retr
84-
[ 4] 0.00-10.00 sec 7.26 GBytes 6.24 Gbits/sec 0 sender
85-
[ 4] 0.00-10.00 sec 7.26 GBytes 6.24 Gbits/sec receiver
86-
87-
```
88-
89-
#### Details and more test results at:
90-
91-
https://github.com/wangyu-/tinyPortMapper/wiki/Performance-Test
1+
# 这是什么?
2+
3+
Fork From : [TinyPortMapper](https://github.com/wangyu-/tinyPortMapper)
4+
5+
简单来说就是一个端口映射工具,饥荒连接板到现在还不官方支持IPv6直连,但我们有一些特殊的方式去完成这件事情,相当于nat64啦。
6+
7+
关键词: 饥荒联机版、IPv6、直连
8+
9+
# 需要怎么做?
10+
11+
## 服务端
12+
13+
搭建好服务器,确认有IPv6公网,确认防火墙允许饥荒联机版默认端口10999和10998通行。
14+
15+
然后使用tinyportmapper去做一个端口映射,对于搭服务器的人来说,这点技术操作属于毛毛雨啦
16+
17+
## 客户端
18+
19+
但是,服务器自然有懂Linux的玩家去操心,但你要让**好不容易拉过来的朋友**通过一系列对他来说超级复杂的操作才能跟你联机一起玩。他可能就*下次一定*了。
20+
21+
所以,我在好哥哥wangyu-的开源代码上修改了一下下,有了这个小软件,你的好朋友只需要双击一下就完成了客户端的端口映射。
22+
23+
当然,默认域名是我自己的域名,你要是想修改默认域名自己下载我这里的源码,改main.cpp里面的默认值,然后使用命令`make mingw_cross`(Ubuntu下要安装mingw-w64)重新编译一下就行。
24+
25+
如果重新编译一下对你来说也有点困难,那么你可以让你的朋友再麻烦那么一丢丢,下载这个软件,在软件所在的目录按住shift+鼠标右键,选择“在此处打开PowerShell”或者"Open in Terminal"就能在当前文件夹打开终端,然后输入`./dstPortMapperClient.exe [domain]`,将domain换成你自己的域名就可以啦。
26+
27+
然后,你的好哥们就可以打开游戏,进入大厅按键盘上的`~`键,输入连接命令`c_connect("127.0.0.1")`回车就可以进房间咯。
28+
29+
30+
31+
# 东西在哪儿?
32+
33+
Github页面的右边,有个大大的Releases,下面有个绿色的Latest,点一下,然后下载dstPortMapperClient.exe
34+

0 commit comments

Comments
 (0)