Comparison

mod_tcpproxy/README.md @ 6211:750d64c47ec6 draft default tip

Merge
author Trần H. Trung <xmpp:trần.h.trung@trung.fun>
date Tue, 18 Mar 2025 00:31:36 +0700
parent 6003:fe081789f7b5
comparison
equal deleted inserted replaced
6210:24316a399978 6211:750d64c47ec6
1 ---
2 labels:
3 - 'Stage-Beta'
4 summary: 'TCP-over-XMPP :)'
5 ...
6
7 Introduction
8 ============
9
10 It happens occasionally that I would like to use the XMPP server as a
11 generic proxy for connecting to another service. It is especially
12 awkward in some environments, and impossible in (for example) Javascript
13 inside a web browser.
14
15 Details
16 =======
17
18 Using mod\_tcpproxy an XMPP client (including those using BOSH) can
19 initiate a pipe to a given TCP/IP address and port. This implementation
20 uses the [In-Band Bytestreams](http://xmpp.org/extensions/xep-0047.html)
21 XEP, simply extended with 2 new attributes in a new namespace, host and
22 port.
23
24 An example Javascript client can be found in the web/ directory of
25 mod\_tcpproxy in the repository.
26
27 Configuration
28 =============
29
30 Just add tcpproxy as a component, for example:
31
32 `Component "tcp.example.com" "tcpproxy"`
33
34 Protocol
35 ========
36
37 A new stream is opened like this:
38
39 ``` {.xml}
40 <iq type="set" id="newconn1" to="tcp.example.com">
41 <open xmlns='http://jabber.org/protocol/ibb'
42 sid='connection1'
43 block-size='4096'
44 stanza='message'
45 xmlns:tcp='http://prosody.im/protocol/tcpproxy'
46 tcp:host='example.com'
47 tcp:port='80' />
48 </iq>
49 ```
50
51 The stanza attribute (currently) MUST be 'message', and block-size is
52 (currently) ignored.
53
54 In response to this stanza you will receive a result upon connection
55 success, or an error if the connection failed. You can then send to the
56 connection by sending message stanzas as described in the IBB XEP.
57 Incoming data will likewise be delivered as messages.
58
59 Compatibility
60 =============
61
62 ----- --------------
63 0.7 Works
64 0.6 Doesn't work
65 ----- --------------
66
67 Todo
68 ====
69
70 - ACLs (restrict to certain JIDs, and/or certain target hosts/ports)
71 - Honour block-size
72 - Support iq stanzas for data transmission
73 - Signal to start SSL/TLS on a connection