Skip to contentSkip to conversation

Socks proxy support for OpenVPN 1.5.0

Openvpn-devel Christof Meerwald 2 participants 4 messages Jan 30, 2004 – Feb 16, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

I have added support for Socks5 proxies to OpenVPN 1.5.0. It should work for TCP and UDP client modes (but I have only tested it in UDP client mode yet, because that's what I plan to use).

I hope you find the patch useful and can integrate it in an upcoming OpenVPN release.

bye, Christof

Signature · 2 lines
http://cmeerw.org                                 JID: [email protected]...
mailto cmeerw at web.de
#1 lore raw
Quoted 3 lines · Christof Meerwald

I have added support for Socks5 proxies to OpenVPN 1.5.0. It should work for TCP and UDP client modes (but I have only tested it in UDP client mode yet, because that's what I plan to use).

I have now also tested the Socks support in TCP client mode and it seems to work, but I have discovered a problem in the Socks support for UDP.

UDP packets might be truncated because the Socks server adds a 10-byte header to them - here is a patch (against 1.6 beta5) to fix it.

bye, Christof

Signature · 2 lines
http://cmeerw.org                                 JID: [email protected]...
mailto cmeerw at web.de
#3 lore raw
In reply to Christof Meerwald

Christof,

Thanks for the patch.

I've merged it in 1.6-beta5, though I haven't tested it yet.

James

Quoted 16 lines · Christof Meerwald

Hi,

I have added support for Socks5 proxies to OpenVPN 1.5.0. It should work for TCP and UDP client modes (but I have only tested it in UDP client mode yet, because that's what I plan to use).

I hope you find the patch useful and can integrate it in an upcoming OpenVPN release.

bye, Christof

Signature · 2 lines
http://cmeerw.org                                 JID: [email protected]...
mailto cmeerw at web.de
#2 lore raw
In reply to Christof Meerwald
Quoted 6 lines · Christof Meerwald
Quoted 3 lines · Christof Meerwald

I have added support for Socks5 proxies to OpenVPN 1.5.0. It should work for TCP and UDP client modes (but I have only tested it in UDP client mode yet, because that's what I plan to use).

UDP packets might be truncated because the Socks server adds a 10-byte header to them - here is a patch (against 1.6 beta5) to fix it.

And here is the fix for the Win32 version:

socket.c +3 -0
diff -ur openvpn-1.6_beta6.orig/socket.c openvpn-1.6_beta6/socket.c
@@ -1364,6 +1364,9 @@
       wsabuf[0].len = maxsize ? maxsize : BLEN (&sock->reads.buf);
       ASSERT (wsabuf[0].len <= BLEN (&sock->reads.buf));
 
+      if (sock->proto == PROTO_UDPv4 && sock->socks_proxy)
+	wsabuf[0].len += 10;
+
       /* the overlapped read will signal this event on I/O completion */
       ASSERT (ResetEvent (sock->reads.overlapped.hEvent));
       sock->reads.flags = 0;

bye, Christof

Signature · 2 lines
http://cmeerw.org                                 JID: [email protected]...
mailto cmeerw at web.de