Path: csiph.com!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Steven Simpson Newsgroups: comp.lang.java.programmer Subject: Re: IllegalArgumentException with Socket API and Proxy with Proxy.Type.HTTP Date: Mon, 30 Jul 2012 13:26:40 +0100 Organization: A noiseless patient Spider Lines: 13 Message-ID: <05bie9-jl9.ln1@s.simpson148.btinternet.com> References: <0ac597b5-4afa-4839-88cf-47c91d6f9b8b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: mx04.eternal-september.org; posting-host="df73166b0df930905a09330fffc6a591"; logging-data="17245"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19pZgxCMSSWDQ+GtvuAI9uNBs0tcA4ynWI=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 In-Reply-To: <0ac597b5-4afa-4839-88cf-47c91d6f9b8b@googlegroups.com> Cancel-Lock: sha1:4AHuQ6fZ0dsthAoVVZII1KZY5C4= Xref: csiph.com comp.lang.java.programmer:16609 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