Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #16762 > unrolled thread

Re: IllegalArgumentException with Socket API and Proxy with Proxy.Type.

Started by"Steven Simpson" <steven.simpson@1:261/38.remove-dpk-this>
First post2012-07-31 18:02 +0000
Last post2012-07-31 18:02 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.java.programmer


Contents

  Re: IllegalArgumentException with Socket API and Proxy with Proxy.Type. "Steven Simpson" <steven.simpson@1:261/38.remove-dpk-this> - 2012-07-31 18:02 +0000

#16762 — Re: IllegalArgumentException with Socket API and Proxy with Proxy.Type.

From"Steven Simpson" <steven.simpson@1:261/38.remove-dpk-this>
Date2012-07-31 18:02 +0000
SubjectRe: IllegalArgumentException with Socket API and Proxy with Proxy.Type.
Message-ID<50181D60.55730.calajapr@time.synchro.net>
  To: Greg
From: "Steven Simpson" <steven.simpson@1:261/38.remove-rf4-this>

  To: Greg
From: Steven Simpson <ss@domain.invalid>

On 26/07/12 18:00, Greg wrote:
> 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.

--
ss at comp dot lancs dot ac dot uk

-+- BBBS/Li6 v4.10 Dada-1
 + Origin: Prism bbs (1:261/38)
-+- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24

--- BBBS/Li6 v4.10 Dada-1
 * Origin: Prism bbs (1:261/38)
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web