• Post Reply Bookmark Topic Watch Topic
  • New Topic

Proxy and FTP Socket

 
Amit Lonkar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have a Socket open on port 21 for FTP service. But I need to go through a proxy. When I try to connect, it throws an IOException as "Permission denied".
Please let me know how I can tell the Socket to pass through the proxy.
Thanks
Amit Lonkar
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Amit Lonkar:
Please let me know how I can tell the Socket to pass through the proxy.
You don't. You should just open the socket to the proxy.
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the Sockets forum.
 
Azriel Abramovich
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please elaborate on how to contact the proxy:
1. how do I autodetect it?
2. how do I 'talk' with it: http://myProxy:888/myUrl ?
10x
Azriel
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This article might be helpful.
 
Azriel Abramovich
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
10x!!! Reading...
 
Van Glass
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are going thru a SOCKS proxy then you can use the following code:
Properties props = System.getProperties();
props.put("socksProxyHost", proxyHostname);
props.put("socksProxyPort", Integer.toString(proxyPort));
System.setProperties(props);
where proxyHostname is your proxy ip address or hostname and proxyPort is your SOCKS proxyPort (default is typically 1080)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!