Software /
code /
prosody
Comparison
plugins/mod_proxy65.lua @ 8728:41c959c5c84b
Fix spelling throughout the codebase [codespell]
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 04 Feb 2018 01:51:25 +0100 |
parent | 8643:11b6aa30b3e0 |
child | 9146:6bd3602a70e2 |
comparison
equal
deleted
inserted
replaced
8727:285075a27f28 | 8728:41c959c5c84b |
---|---|
42 return; | 42 return; |
43 end | 43 end |
44 end -- else error, unexpected input | 44 end -- else error, unexpected input |
45 conn:write("\5\255"); -- send (SOCKS version 5, no acceptable method) | 45 conn:write("\5\255"); -- send (SOCKS version 5, no acceptable method) |
46 conn:close(); | 46 conn:close(); |
47 module:log("debug", "Invalid SOCKS5 greeting recieved: '%s'", b64(data)); | 47 module:log("debug", "Invalid SOCKS5 greeting received: '%s'", b64(data)); |
48 else -- connection request | 48 else -- connection request |
49 --local head = string.char( 0x05, 0x01, 0x00, 0x03, 40 ); -- ( VER=5=SOCKS5, CMD=1=CONNECT, RSV=0=RESERVED, ATYP=3=DOMAIMNAME, SHA-1 size ) | 49 --local head = string.char( 0x05, 0x01, 0x00, 0x03, 40 ); -- ( VER=5=SOCKS5, CMD=1=CONNECT, RSV=0=RESERVED, ATYP=3=DOMAIMNAME, SHA-1 size ) |
50 if #data == 47 and data:sub(1,5) == "\5\1\0\3\40" and data:sub(-2) == "\0\0" then | 50 if #data == 47 and data:sub(1,5) == "\5\1\0\3\40" and data:sub(-2) == "\0\0" then |
51 local sha = data:sub(6, 45); | 51 local sha = data:sub(6, 45); |
52 conn:pause(); | 52 conn:pause(); |
64 server.link(transfers[sha].target, conn, max_buffer_size); | 64 server.link(transfers[sha].target, conn, max_buffer_size); |
65 end | 65 end |
66 else -- error, unexpected input | 66 else -- error, unexpected input |
67 conn:write("\5\1\0\3\0\0\0"); -- VER, REP, RSV, ATYP, BND.ADDR (sha), BND.PORT (2 Byte) | 67 conn:write("\5\1\0\3\0\0\0"); -- VER, REP, RSV, ATYP, BND.ADDR (sha), BND.PORT (2 Byte) |
68 conn:close(); | 68 conn:close(); |
69 module:log("debug", "Invalid SOCKS5 negotiation recieved: '%s'", b64(data)); | 69 module:log("debug", "Invalid SOCKS5 negotiation received: '%s'", b64(data)); |
70 end | 70 end |
71 end | 71 end |
72 end | 72 end |
73 | 73 |
74 function listener.ondisconnect(conn) | 74 function listener.ondisconnect(conn) |