mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
tcptoudp, udptotcp: tunnels between TCP and UDP
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI MacOS / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI Windows / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Has been cancelled
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI Linux / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI MacOS / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI Windows / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI cmake / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
C/C++ CI cmake / ubuntu-latest (wolfSSL) (push) Has been cancelled
Datagrams on a TCP connection, each with a two byte length in network order in front of it, which is how udptunnel (the rfc1036 one) and ProxyGuard (eduVPN) put them there, the framing alone or after a handshake: udptunnel's 32 bytes, or ProxyGuard's HTTP Upgrade for UoTLV/1 answered with 101 Switching Protocols. tcptoudp takes the connections, a UDP socket of its own to the target for each, the handshake a client speaks recognised by its first bytes and answered; a parent the ACL gives is a SOCKS5 UDP relay, as for udppm. udptotcp takes the datagrams, each client a session of the service's with a TCP connection of its own, connected as the service's loop sees it writable (dnspr asks a name server over TCP the same way); -m sends udptunnel's handshake to the target, -m2 ProxyGuard's, -m0 (the default) none, so both ends of either tool are stood in for. The service names take two places of the string table, the default configuration path moving two later (stringtable[27]). Built by the Makefiles and CMake, with the standalone binaries, and installed by them; a case of the test suite speaks all three handshakes.
This commit is contained in:
1 parent
79583d7aa7
commit
51559e12c4
21 files changed
+1043
-28
No files matched your search
+3
-1
@@ -32,6 +32,8 @@ from the configuration file like an independent service
|
||||
.BR imapp (8)
|
||||
.BR tcppm (8)
|
||||
.BR udppm (8)
|
||||
.BR tcptoudp (8)
|
||||
.BR udptotcp (8)
|
||||
.BR ftppr (8)
|
||||
.BR dnspr
|
||||
but
|
||||
@@ -161,7 +163,7 @@ configuration file
|
||||
Report all bugs to
|
||||
.BR 3proxy@3proxy.org
|
||||
.SH SEE ALSO
|
||||
3proxy.cfg(5), proxy(8), ftppr(8), socks(8), pop3p(8), imapp(8), tcppm(8), udppm(8),
|
||||
3proxy.cfg(5), proxy(8), ftppr(8), socks(8), pop3p(8), imapp(8), tcppm(8), udppm(8), tcptoudp(8), udptotcp(8),
|
||||
kill(1), syslogd(8),
|
||||
.br
|
||||
https://3proxy.org/
|
||||
|
||||
+28
-1
@@ -79,6 +79,14 @@ Recursion is not allowed.
|
||||
.B udppm
|
||||
[options]
|
||||
\fI<SRCPORT>\fR \fI<DSTADDR>\fR \fI<DSTPORT>\fR
|
||||
.br
|
||||
.B tcptoudp
|
||||
[options]
|
||||
\fI<SRCPORT>\fR \fI<DSTADDR>\fR \fI<DSTPORT>\fR
|
||||
.br
|
||||
.B udptotcp
|
||||
[options]
|
||||
\fI<SRCPORT>\fR \fI<DSTADDR>\fR \fI<DSTPORT>\fR
|
||||
.br
|
||||
Descriptions:
|
||||
.br
|
||||
@@ -127,6 +135,25 @@ but must be specified for syntax compatibility.
|
||||
.B udppm
|
||||
UDP portmapper
|
||||
|
||||
.br
|
||||
.B tcptoudp
|
||||
TCP to UDP tunnel: connections on SRCPORT carry datagrams, each with a
|
||||
two byte length in network order in front of it, sent as UDP datagrams
|
||||
to DSTADDR:DSTPORT, the answers framed the same way back. The handshake
|
||||
a client speaks \(em udptunnel's (the rfc1036 one) or ProxyGuard's HTTP
|
||||
Upgrade for UoTLV/1 (eduVPN) \(em is recognised and answered; a
|
||||
connection that begins with a length needs none. Each connection has a
|
||||
UDP socket of its own to the target.
|
||||
|
||||
.br
|
||||
.B udptotcp
|
||||
UDP to TCP tunnel: each client sending datagrams to SRCPORT is a session
|
||||
of the service with a TCP connection of its own to DSTADDR:DSTPORT, its
|
||||
datagrams sent on it with a two byte length in front of each, what comes
|
||||
back answered to the client. \fB-m\fR sends udptunnel's handshake to the
|
||||
target first, \fB-m2\fR ProxyGuard's (an HTTP Upgrade for UoTLV/1), \fB-m0\fR
|
||||
sends none, which is the default.
|
||||
|
||||
.br
|
||||
Options:
|
||||
.br
|
||||
@@ -2085,7 +2112,7 @@ the tree is refused outright.
|
||||
Report all bugs to
|
||||
.BR 3proxy@3proxy.org
|
||||
.SH SEE ALSO
|
||||
3proxy(8), 3proxy_crypt(8), proxy(8), ftppr(8), socks(8), pop3p(8), imapp(8), smtpp(8), tlspr(8), tcppm(8), udppm(8), syslogd(8),
|
||||
3proxy(8), 3proxy_crypt(8), proxy(8), ftppr(8), socks(8), pop3p(8), imapp(8), smtpp(8), tlspr(8), tcppm(8), udppm(8), tcptoudp(8), udptotcp(8), syslogd(8),
|
||||
.br
|
||||
https://3proxy.org/
|
||||
.SH AUTHORS
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
.TH tcptoudp "8" "November 2026" "3proxy" "Universal proxy server"
|
||||
.SH NAME
|
||||
.B tcptoudp
|
||||
\- TCP to UDP tunnel
|
||||
.SH SYNOPSIS
|
||||
.BR "tcptoudp " [ -d ]
|
||||
.IB \fR[ -l \fR[ \fR[ @ \fR] logfile \fR]]
|
||||
.IB \fR[ -i internal_ip\fR]
|
||||
.IB \fR[ -e external_ip\fR]
|
||||
.I local_port remote_host remote_port
|
||||
.SH DESCRIPTION
|
||||
.B tcptoudp
|
||||
takes TCP connections on
|
||||
.I local_port
|
||||
and sends what they carry as datagrams to
|
||||
.IR remote_host : remote_port ,
|
||||
framing each datagram with its length on the connection. This is the
|
||||
server side of udptunnel (the rfc1036 one, started with \fB-s\fR) and of
|
||||
ProxyGuard (eduVPN), whose clients it answers: a connection that begins
|
||||
with udptunnel's 32 byte handshake has it taken off, one that asks with
|
||||
an HTTP Upgrade for UoTLV/1 is told the protocols are switched, and one
|
||||
that begins with a length goes to the framing at once. What comes back
|
||||
from the target is sent on the connection framed the same way. Each
|
||||
connection has a UDP socket of its own to the target; a parent the ACL
|
||||
gives is a SOCKS5 UDP relay, as for udppm.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B -I
|
||||
Inetd mode. Standalone service only.
|
||||
.TP
|
||||
.B -d
|
||||
Daemonize. Detach service from console and run in the background.
|
||||
.TP
|
||||
.B -t
|
||||
Be silenT. Do not log start/stop/accept error records.
|
||||
.TP
|
||||
.B -e
|
||||
External address. IP address of the interface the proxy should send datagrams
|
||||
from.
|
||||
By default, the system will decide which address to use in accordance
|
||||
with the routing table.
|
||||
.TP
|
||||
.B \-ni\fIPATH\fR
|
||||
(Linux only) Switch to the network namespace identified by
|
||||
.I PATH
|
||||
before opening the listening socket. The current namespace is saved and restored
|
||||
immediately after binding, so outgoing datagrams run in the original namespace
|
||||
unless
|
||||
.B \-ne
|
||||
is also given.
|
||||
.TP
|
||||
.B \-ne\fIPATH\fR
|
||||
(Linux only) Switch to the network namespace identified by
|
||||
.I PATH
|
||||
after the listening socket has been bound (and after restoring from
|
||||
.B \-ni
|
||||
if applicable). Both options accept any namespace file path
|
||||
(e.g.\& \fI/var/run/netns/myns\fR or \fI/proc/PID/ns/net\fR)
|
||||
and require \fBCAP_SYS_ADMIN\fR.
|
||||
.TP
|
||||
.B -i
|
||||
Internal address. IP address the proxy accepts connections to.
|
||||
By default, connections to any interface are accepted. It\'s usually unsafe.
|
||||
.TP
|
||||
.B -l
|
||||
Log. By default logging is to stdout. If
|
||||
.I logfile
|
||||
is specified logging is to file. Under Unix, if
|
||||
.RI \' @ \'
|
||||
precedes
|
||||
.IR logfile ,
|
||||
syslog is used for logging.
|
||||
.TP
|
||||
.B -S
|
||||
Increase or decrease stack size. You may want to try something like -S8192 if you experience 3proxy
|
||||
crashes.
|
||||
.SH ARGUMENTS
|
||||
.TP
|
||||
.I local_port
|
||||
- port tcptoudp accepts connections on
|
||||
.TP
|
||||
.I remote_host
|
||||
- IP address of the host datagrams are sent to
|
||||
.TP
|
||||
.I remote_port
|
||||
- remote port datagrams are sent to
|
||||
.SH CLIENTS
|
||||
udptunnel's client (without \fB-s\fR), ProxyGuard's client
|
||||
(\fBproxyguard-client\fR), or anything that puts datagrams on a TCP
|
||||
connection with a two byte length in network order in front of each.
|
||||
.SH BUGS
|
||||
Report all bugs to
|
||||
.BR 3proxy@3proxy.org
|
||||
.SH SEE ALSO
|
||||
3proxy(8), 3proxy.cfg(5), udptotcp(8), tcppm(8), udppm(8), syslogd(8),
|
||||
.br
|
||||
https://3proxy.org/
|
||||
.SH AUTHORS
|
||||
3proxy is designed by Vladimir Dubrovin <vlad@3proxy.org>
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
.TH udptotcp "8" "November 2026" "3proxy" "Universal proxy server"
|
||||
.SH NAME
|
||||
.B udptotcp
|
||||
\- UDP to TCP tunnel
|
||||
.SH SYNOPSIS
|
||||
.BR "udptotcp " [ -d ", " \fR[ -m \fR| \fR -m2 \fR| \fR -m0 \fR] ]
|
||||
.IB \fR[ -l \fR[ \fR[ @ \fR] logfile \fR]]
|
||||
.IB \fR[ -i internal_ip\fR]
|
||||
.IB \fR[ -e external_ip\fR]
|
||||
.I local_port remote_host remote_port
|
||||
.SH DESCRIPTION
|
||||
.B udptotcp
|
||||
takes datagrams on
|
||||
.I local_port
|
||||
and sends them on a TCP connection to
|
||||
.IR remote_host : remote_port ,
|
||||
each with its length in front of it. This is the client side of udptunnel
|
||||
(the rfc1036 one) and of ProxyGuard (eduVPN): each client is a session of
|
||||
the service with a TCP connection of its own, and what comes back on the
|
||||
connection is answered to that client as datagrams. A parent the ACL
|
||||
gives is asked for a TCP connection to the target, not a UDP relay as
|
||||
udppm's.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B -I
|
||||
Inetd mode. Standalone service only.
|
||||
.TP
|
||||
.B -d
|
||||
Daemonize. Detach service from console and run in the background.
|
||||
.TP
|
||||
.B -t
|
||||
Be silenT. Do not log start/stop/accept error records.
|
||||
.TP
|
||||
.B -e
|
||||
External address. IP address of the interface the proxy should initiate the
|
||||
TCP connection from.
|
||||
By default, the system will decide which address to use in accordance
|
||||
with the routing table.
|
||||
.TP
|
||||
.B \-ni\fIPATH\fR
|
||||
(Linux only) Switch to the network namespace identified by
|
||||
.I PATH
|
||||
before opening the listening socket. The current namespace is saved and restored
|
||||
immediately after binding, so the TCP connection runs in the original namespace
|
||||
unless
|
||||
.B \-ne
|
||||
is also given.
|
||||
.TP
|
||||
.B \-ne\fIPATH\fR
|
||||
(Linux only) Switch to the network namespace identified by
|
||||
.I PATH
|
||||
after the listening socket has been bound (and after restoring from
|
||||
.B \-ni
|
||||
if applicable). Both options accept any namespace file path
|
||||
(e.g.\& \fI/var/run/netns/myns\fR or \fI/proc/PID/ns/net\fR)
|
||||
and require \fBCAP_SYS_ADMIN\fR.
|
||||
.TP
|
||||
.B -i
|
||||
Internal address. IP address the proxy accepts datagrams to.
|
||||
By default, datagrams to any interface are accepted. It\'s usually unsafe.
|
||||
.TP
|
||||
.B -l
|
||||
Log. By default logging is to stdout. If
|
||||
.I logfile
|
||||
is specified logging is to file. Under Unix, if
|
||||
.RI \' @ \'
|
||||
precedes
|
||||
.IR logfile ,
|
||||
syslog is used for logging.
|
||||
.TP
|
||||
.B -m
|
||||
udptunnel's handshake: the 32 bytes a client of udptunnel sends are sent
|
||||
to the target before the datagrams.
|
||||
.TP
|
||||
.B -m2
|
||||
ProxyGuard's handshake: an HTTP Upgrade for UoTLV/1 is asked of the
|
||||
target, and the datagrams begin once the target has switched protocols.
|
||||
.TP
|
||||
.B -m0
|
||||
No handshake: the datagrams are sent with none at all, which tcptoudp
|
||||
and ProxyGuard's server also take. This is the default.
|
||||
.TP
|
||||
.B -S
|
||||
Increase or decrease stack size. You may want to try something like -S8192 if you experience 3proxy
|
||||
crashes.
|
||||
.SH ARGUMENTS
|
||||
.TP
|
||||
.I local_port
|
||||
- port udptotcp accepts datagrams on
|
||||
.TP
|
||||
.I remote_host
|
||||
- IP address of the host the TCP connection is made to
|
||||
.TP
|
||||
.I remote_port
|
||||
- remote port the TCP connection is made to
|
||||
.SH CLIENTS
|
||||
Any UDP-based application can be used as a client. Use
|
||||
.I internal_ip
|
||||
and
|
||||
.I local_port
|
||||
as the destination in the client application. The datagrams are carried
|
||||
to
|
||||
.IR remote_host : remote_port
|
||||
and the answers come back.
|
||||
.SH BUGS
|
||||
Report all bugs to
|
||||
.BR 3proxy@3proxy.org
|
||||
.SH SEE ALSO
|
||||
3proxy(8), 3proxy.cfg(5), tcptoudp(8), tcppm(8), udppm(8), syslogd(8),
|
||||
.br
|
||||
https://3proxy.org/
|
||||
.SH AUTHORS
|
||||
3proxy is designed by Vladimir Dubrovin <vlad@3proxy.org>
|
||||
Reference in new issue
Block a user