Software /
code /
verse
Annotate
plugins/jingle_s5b.lua @ 288:22544dcf0579
plugins.jingle_s5b: Add local verse
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 30 Mar 2012 00:16:50 +0200 |
parent | 140:97bf22d6ff96 |
child | 289:8bbe0d6dfd11 |
rev | line source |
---|---|
288
22544dcf0579
plugins.jingle_s5b: Add local verse
Kim Alvefur <zash@zash.se>
parents:
140
diff
changeset
|
1 local verse = require "verse"; |
101
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
2 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
3 local xmlns_s5b = "urn:xmpp:jingle:transports:s5b:1"; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
4 local sha1 = require "util.sha1".sha1; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
5 local uuid_generate = require "util.uuid".generate; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
6 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
7 local function negotiate_socks5(conn, hash) |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
8 local function suppress_connected() |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
9 conn:unhook("connected", suppress_connected); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
10 return true; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
11 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
12 local function receive_connection_response(data) |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
13 conn:unhook("incoming-raw", receive_connection_response); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
14 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
15 if data:sub(1, 2) ~= "\005\000" then |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
16 return conn:event("error", "connection-failure"); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
17 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
18 conn:event("connected"); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
19 return true; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
20 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
21 local function receive_auth_response(data) |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
22 conn:unhook("incoming-raw", receive_auth_response); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
23 if data ~= "\005\000" then -- SOCKSv5; "NO AUTHENTICATION" |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
24 -- Server is not SOCKSv5, or does not allow no auth |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
25 local err = "version-mismatch"; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
26 if data:sub(1,1) == "\005" then |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
27 err = "authentication-failure"; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
28 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
29 return conn:event("error", err); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
30 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
31 -- Request SOCKS5 connection |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
32 conn:send(string.char(0x05, 0x01, 0x00, 0x03, #hash)..hash.."\0\0"); --FIXME: Move to "connected"? |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
33 conn:hook("incoming-raw", receive_connection_response, 100); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
34 return true; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
35 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
36 conn:hook("connected", suppress_connected, 200); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
37 conn:hook("incoming-raw", receive_auth_response, 100); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
38 conn:send("\005\001\000"); -- SOCKSv5; 1 mechanism; "NO AUTHENTICATION" |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
39 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
40 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
41 local function connect_to_usable_streamhost(callback, streamhosts, auth_token) |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
42 local conn = verse.new(nil, { |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
43 streamhosts = streamhosts, |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
44 current_host = 0; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
45 }); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
46 --Attempt to connect to the next host |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
47 local function attempt_next_streamhost(event) |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
48 if event then |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
49 return callback(nil, event.reason); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
50 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
51 -- First connect, or the last connect failed |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
52 if conn.current_host < #conn.streamhosts then |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
53 conn.current_host = conn.current_host + 1; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
54 conn:debug("Attempting to connect to "..conn.streamhosts[conn.current_host].host..":"..conn.streamhosts[conn.current_host].port.."..."); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
55 local ok, err = conn:connect( |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
56 conn.streamhosts[conn.current_host].host, |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
57 conn.streamhosts[conn.current_host].port |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
58 ); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
59 if not ok then |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
60 conn:debug("Error connecting to proxy (%s:%s): %s", |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
61 conn.streamhosts[conn.current_host].host, |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
62 conn.streamhosts[conn.current_host].port, |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
63 err |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
64 ); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
65 else |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
66 conn:debug("Connecting..."); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
67 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
68 negotiate_socks5(conn, auth_token); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
69 return true; -- Halt processing of disconnected event |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
70 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
71 -- All streamhosts tried, none successful |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
72 conn:unhook("disconnected", attempt_next_streamhost); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
73 return callback(nil); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
74 -- Let disconnected event fall through to user handlers... |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
75 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
76 conn:hook("disconnected", attempt_next_streamhost, 100); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
77 -- When this event fires, we're connected to a streamhost |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
78 conn:hook("connected", function () |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
79 conn:unhook("disconnected", attempt_next_streamhost); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
80 callback(conn.streamhosts[conn.current_host], conn); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
81 end, 100); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
82 attempt_next_streamhost(); -- Set it in motion |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
83 return conn; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
84 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
85 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
86 function verse.plugins.jingle_s5b(stream) |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
87 stream:hook("ready", function () |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
88 stream:add_disco_feature(xmlns_s5b); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
89 end, 10); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
90 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
91 local s5b = {}; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
92 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
93 function s5b:generate_initiate() |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
94 self.s5b_sid = uuid_generate(); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
95 local transport = verse.stanza("transport", { xmlns = xmlns_s5b, |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
96 mode = "tcp", sid = self.s5b_sid }); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
97 local p = 0; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
98 for jid, streamhost in pairs(stream.proxy65.available_streamhosts) do |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
99 p = p + 1; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
100 transport:tag("candidate", { jid = jid, host = streamhost.host, |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
101 port = streamhost.port, cid=jid, priority = p, type = "proxy" }):up(); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
102 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
103 stream:debug("Have %d proxies", p) |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
104 return transport; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
105 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
106 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
107 function s5b:generate_accept(initiate_transport) |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
108 local candidates = {}; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
109 self.s5b_peer_candidates = candidates; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
110 self.s5b_mode = initiate_transport.attr.mode or "tcp"; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
111 self.s5b_sid = initiate_transport.attr.sid or self.jingle.sid; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
112 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
113 -- Import the list of candidates the initiator offered us |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
114 for candidate in initiate_transport:childtags() do |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
115 --if candidate.attr.jid == "asterix4@jabber.lagaule.org/Gajim" |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
116 --and candidate.attr.host == "82.246.25.239" then |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
117 candidates[candidate.attr.cid] = { |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
118 type = candidate.attr.type; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
119 jid = candidate.attr.jid; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
120 host = candidate.attr.host; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
121 port = tonumber(candidate.attr.port) or 0; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
122 priority = tonumber(candidate.attr.priority) or 0; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
123 cid = candidate.attr.cid; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
124 }; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
125 --end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
126 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
127 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
128 -- Import our own candidates |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
129 -- TODO ^ |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
130 local transport = verse.stanza("transport", { xmlns = xmlns_s5b }); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
131 return transport; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
132 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
133 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
134 function s5b:connect(callback) |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
135 stream:warn("Connecting!"); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
136 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
137 local streamhost_array = {}; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
138 for cid, streamhost in pairs(self.s5b_peer_candidates or {}) do |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
139 streamhost_array[#streamhost_array+1] = streamhost; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
140 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
141 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
142 if #streamhost_array > 0 then |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
143 self.connecting_peer_candidates = true; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
144 local function onconnect(streamhost, conn) |
140
97bf22d6ff96
plugins.jingle, plugins.jingle_s5b: API changes to allow not sending <reason> inside <content> when transfer succeeds
Matthew Wild <mwild1@gmail.com>
parents:
101
diff
changeset
|
145 self.jingle:send_command("transport-info", verse.stanza("content", { creator = self.creator, name = self.name }) |
97bf22d6ff96
plugins.jingle, plugins.jingle_s5b: API changes to allow not sending <reason> inside <content> when transfer succeeds
Matthew Wild <mwild1@gmail.com>
parents:
101
diff
changeset
|
146 :tag("transport", { xmlns = xmlns_s5b, sid = self.s5b_sid }) |
97bf22d6ff96
plugins.jingle, plugins.jingle_s5b: API changes to allow not sending <reason> inside <content> when transfer succeeds
Matthew Wild <mwild1@gmail.com>
parents:
101
diff
changeset
|
147 :tag("candidate-used", { cid = streamhost.cid })); |
101
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
148 self.onconnect_callback = callback; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
149 self.conn = conn; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
150 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
151 local auth_token = sha1(self.s5b_sid..self.peer..stream.jid, true); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
152 connect_to_usable_streamhost(onconnect, streamhost_array, auth_token); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
153 else |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
154 stream:warn("Actually, I'm going to wait for my peer to tell me its streamhost..."); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
155 self.onconnect_callback = callback; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
156 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
157 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
158 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
159 function s5b:info_received(jingle_tag) |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
160 stream:warn("Info received"); |
140
97bf22d6ff96
plugins.jingle, plugins.jingle_s5b: API changes to allow not sending <reason> inside <content> when transfer succeeds
Matthew Wild <mwild1@gmail.com>
parents:
101
diff
changeset
|
161 local content_tag = jingle_tag:child_with_name("content"); |
97bf22d6ff96
plugins.jingle, plugins.jingle_s5b: API changes to allow not sending <reason> inside <content> when transfer succeeds
Matthew Wild <mwild1@gmail.com>
parents:
101
diff
changeset
|
162 local transport_tag = content_tag:child_with_name("transport"); |
101
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
163 if transport_tag:get_child("candidate-used") and not self.connecting_peer_candidates then |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
164 local candidate_used = transport_tag:child_with_name("candidate-used"); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
165 if candidate_used then |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
166 -- Connect straight away to candidate used, we weren't trying any anyway |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
167 local function onconnect(streamhost, conn) |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
168 if self.jingle.role == "initiator" then -- More correct would be - "is this a candidate we offered?" |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
169 -- Activate the stream |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
170 self.jingle.stream:send_iq(verse.iq({ to = streamhost.jid, type = "set" }) |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
171 :tag("query", { xmlns = xmlns_bytestreams, sid = self.s5b_sid }) |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
172 :tag("activate"):text(self.jingle.peer), function (result) |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
173 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
174 if result.attr.type == "result" then |
140
97bf22d6ff96
plugins.jingle, plugins.jingle_s5b: API changes to allow not sending <reason> inside <content> when transfer succeeds
Matthew Wild <mwild1@gmail.com>
parents:
101
diff
changeset
|
175 self.jingle:send_command("transport-info", verse.stanza("content", content_tag.attr) |
97bf22d6ff96
plugins.jingle, plugins.jingle_s5b: API changes to allow not sending <reason> inside <content> when transfer succeeds
Matthew Wild <mwild1@gmail.com>
parents:
101
diff
changeset
|
176 :tag("transport", { xmlns = xmlns_s5b, sid = self.s5b_sid }) |
97bf22d6ff96
plugins.jingle, plugins.jingle_s5b: API changes to allow not sending <reason> inside <content> when transfer succeeds
Matthew Wild <mwild1@gmail.com>
parents:
101
diff
changeset
|
177 :tag("activated", { cid = candidate_used.attr.cid })); |
101
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
178 self.conn = conn; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
179 self.onconnect_callback(conn); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
180 else |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
181 self.jingle.stream:error("Failed to activate bytestream"); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
182 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
183 end); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
184 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
185 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
186 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
187 -- FIXME: Another assumption that cid==jid, and that it was our candidate |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
188 self.jingle.stream:debug("CID: %s", self.jingle.stream.proxy65.available_streamhosts[candidate_used.attr.cid]); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
189 local streamhost_array = { |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
190 self.jingle.stream.proxy65.available_streamhosts[candidate_used.attr.cid]; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
191 }; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
192 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
193 local auth_token = sha1(self.s5b_sid..stream.jid..self.peer, true); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
194 connect_to_usable_streamhost(onconnect, streamhost_array, auth_token); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
195 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
196 elseif transport_tag:get_child("activated") then |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
197 self.onconnect_callback(self.conn); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
198 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
199 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
200 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
201 function s5b:disconnect() |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
202 if self.conn then |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
203 self.conn:close(); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
204 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
205 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
206 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
207 function s5b:handle_accepted(jingle_tag) |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
208 end |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
209 |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
210 local s5b_mt = { __index = s5b }; |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
211 stream:hook("jingle/transport/"..xmlns_s5b, function (jingle) |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
212 return setmetatable({ |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
213 role = jingle.role, |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
214 peer = jingle.peer, |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
215 stream = jingle.stream, |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
216 jingle = jingle, |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
217 }, s5b_mt); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
218 end); |
9c5362d393f0
verse.plugins.jingle_s5b: Jingle SOCKS5 Bytestreams transport
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
219 end |