IllegalArgumentException with Socket API and Proxy with Proxy.Type.HTTP

G

Greg

I am trying to create a socket with the proxy type of HTTP. Every time thesocket is created an IllegalArgumentException is thrown. I have learned from googling that the HTTP proxy is unsupported in sockets. What is the work around? Does anyone know? Any help would be much appreciated as there doesn't seem to be an answer readily available that I can find.

Greg
 
K

Knute Johnson

I am trying to create a socket with the proxy type of HTTP. Every
time the socket is created an IllegalArgumentException is thrown. I
have learned from googling that the HTTP proxy is unsupported in
sockets. What is the work around? Does anyone know? Any help would
be much appreciated as there doesn't seem to be an answer readily
available that I can find.

Greg

You can set up proxies in the Java Control Panel.
 
S

Steven Simpson

I am trying to create a socket with the proxy type of HTTP. Every time the socket is created an IllegalArgumentException is thrown. I have learned from googling that the HTTP proxy is unsupported in sockets. What is the work around?

How much does the code using the Socket depend on its 'interface'?
Perhaps it would be happy with (say) just getInputStream() and
getOutputStream() on an already connected Socket. If so, then perhaps
you can connect to the proxy explicitly, send "CONNECT" yourself, and
parse the response header. If all goes okay, hand the socket as is over
to the 'using' code, and it won't know the difference.
 
G

Greg

I am trying to create a socket with the proxy type of HTTP. Every time the socket is created an IllegalArgumentException is thrown. I have learnedfrom googling that the HTTP proxy is unsupported in sockets. What is the work around? Does anyone know? Any help would be much appreciated as there doesn't seem to be an answer readily available that I can find.



Greg

The code pretty extensively relies on the sockets interface.
 
S

Steven Simpson

The code pretty extensively relies on the sockets interface.

Can you define 'pretty extensively', i.e. enumerate the methods which
are used, and in what sequences? If this is sufficiently simple, and
you can modify the code, some refactoring to use your own abstraction of
the socket ought to be possible.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,965
Messages
2,570,148
Members
46,710
Latest member
FredricRen

Latest Threads

Top