开发者

Java: DatagramSocket and proxy (firewall)

开发者 https://www.devze.com 2023-02-02 02:36 出处:网络
It may be that I\'m not understanding the UDP protocol... I\'m trying to receive data from a server using the UDP protocol, but I\'m sitting behind a firewall.The URLConnection constructor can take a

It may be that I'm not understanding the UDP protocol...

I'm trying to receive data from a server using the UDP protocol, but I'm sitting behind a firewall. The URLConnection constructor can take an inst开发者_JS百科ance of Proxy (as well as a way to set up user name and password of such a proxy server).

How do I connect through a proxy server using the UDP protocol (DatagramSocket)?

Best regards, TX


Most Proxy servers support the HTTP protocol which is TCP based, so you don't have to do anything with the proxy server to do this.

To pass UDP over a proxy server, you need a proxy which supports UDP. I don't know of any proxy server which supports this so you may have to write one yourself. It is worth noting that UDP is a connectionless protocol which means you have have to authenticate every packet.


SOCKS5, which is an extension of SOCKS4, includes support for UDP in addition to authentication. One implementation of a SOCKS5 Server written in Java is JSOCKS. You can check this project out at http://jsocks.sourceforge.net/.

Refer to RFC 1928 (https://www.rfc-editor.org/rfc/rfc1928) for more information on SOCKS5.

0

精彩评论

暂无评论...
验证码 换一张
取 消