You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-7Lines changed: 18 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ Minecraft Versions before 12w04a are **NOT SUPPORTED**!
10
10
## Features
11
11
* Support reverse proxy for Minecraft servers by server address in the handshake packet which client send to.
12
12
* Support rewrite server address and server port to camouflage connection which using official server address. (eg: pretend to be a normal connection to Hypixel, avoiding their server address check.)
13
+
* Support IP forwarding using HAProxy's Proxy Protocol. (But refuses any incoming connection using this protocol.)
13
14
14
15
## Requirements
15
16
* Linux
@@ -24,10 +25,10 @@ Minecraft Versions before 12w04a are **NOT SUPPORTED**!
24
25
## Files
25
26
* mcrelay.c: Source code of Main program.
26
27
* mcrelay.conf.example: config file example of mcrelay.
27
-
* mcrelay.service.forking.example: service unit file of mcrelay for systemd(using runmode: forking).
28
-
* mcrelay.service.simple.example: service unit file of mcrelay for systemd(using runmode: simple).
28
+
* mcrelay.service.forking.example: service unit file of mcrelay for systemd. (using runmode: forking)
29
+
* mcrelay.service.simple.example: service unit file of mcrelay for systemd. (using runmode: simple)
29
30
* mod: directory of essential modules.
30
-
* version.json: version manifest
31
+
* version.json: version manifest.
31
32
* loglevel.info: definations for messages.
32
33
33
34
## Compile
@@ -60,6 +61,7 @@ proxy_pass proxy_type
60
61
ident_name destination_object
61
62
default destination_object
62
63
</pre>
64
+
63
65
### Explanation
64
66
* log: set log file.
65
67
>* logfile_path: path of the file which logs saved to.
@@ -71,18 +73,19 @@ default destination_object
71
73
>>* port: the port you wish to bind as an Internet Service. Valid range: 1-65535.
72
74
* proxy_pass: list of relay/relay+rewrites.
73
75
>* proxy_type: type of proxies, "relay" for raw relay, "rewrite" for relay with server address camouflage enabled.
74
-
>* ident_name: name of destination identification. Usually a Fully Qualified Domain Name(FQDN) by CNAME to your server.
76
+
>>* You can add "p" suffix (i.e. "relayp" or "rewritep") to enable IP forwarding. (Need downstream supports HAProxy's Proxy Protocol, otherwise your connection will be aborted.)
77
+
>* ident_name: name of destination identification. Usually a Fully Qualified Domain Name (FQDN) by CNAME to your server.
>>* address_d: the address you wish to connect. Both FQDN or x.x.x.x allowed.
77
80
>>* port: optional, the port you wish to connect. Valid range: 1-65535.
78
81
79
-
If not set, the server will detect SRV record first(defined in address_d).
82
+
If not set, the server will detect SRV record first. (defined in address_d)
80
83
81
84
If SRV record resolve failed, it will fallback to normal address resolve, also connect to this address with port 25565.
82
85
83
86
**For rewrite enabled relay, it will use actual connect configuration to rewrite.**
84
-
>>* path: the socket file you wish to connect.
85
87
* default: optional, set a default server to connect when client don't match any valid virtual host. (Intentionally not support rewrite here.) (Security suggestion: Don't use this feature unless you know what you are doing.)
88
+
86
89
### Example
87
90
<pre>
88
91
log /var/log/mcrelay/mcrelay.log
@@ -96,7 +99,7 @@ proxy_pass relay
96
99
default 192.168.1.254:25565
97
100
</pre>
98
101
99
-
## Instruction of using a DNS-based redirection(SRV)
102
+
## Instruction of using a DNS-based redirection(SRV)
100
103
If you are using a SRV record to provide your service, you should follow the instructions below.
101
104
102
105
Otherwise, your user will see the message of using a wrong address to connect.
@@ -110,3 +113,11 @@ If you provide "srvrecord.example.com" to your user, you should set your vhostna
110
113
* For Minecraft version from 21w20a to 1.17, use "srvrecord.example.com".
111
114
112
115
For compatibility, it's recommended to add both of them to your configuration.
116
+
117
+
## IP Forwarding
118
+
You can provide the real client address and port through HAProxy's Proxy Protocol by this feature.
119
+
120
+
It's compatible with any server which support this protocol. (e.g. Bungeecord)
121
+
122
+
### Bungeecord
123
+
To use this feature correctly, turn on the "proxy_protocol" in the "config.yml". ("false" to "true")
0 commit comments