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

Discussion in 'Java' started by Greg, Jul 26, 2012.

  1. Greg

    Greg Guest

    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
     
    Greg, Jul 26, 2012
    #1
    1. Advertising

  2. On 7/26/2012 10:00 AM, 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? 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.
     
    Knute Johnson, Jul 29, 2012
    #2
    1. Advertising

  3. 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
     
    Steven Simpson, Jul 30, 2012
    #3
  4. Greg

    Greg Guest

    On Thursday, July 26, 2012 10:00:23 AM UTC-7, 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 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.
     
    Greg, Aug 9, 2012
    #4
  5. On 09/08/12 21:40, Greg wrote:
    > On Thursday, July 26, 2012 10:00:23 AM UTC-7, 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.

    > 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.

    --
    ss at comp dot lancs dot ac dot uk
     
    Steven Simpson, Aug 16, 2012
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Knute Johnson
    Replies:
    0
    Views:
    204
    Knute Johnson
    Jul 29, 2012
  2. Knute Johnson
    Replies:
    0
    Views:
    173
    Knute Johnson
    Jul 29, 2012
  3. Knute Johnson
    Replies:
    0
    Views:
    146
    Knute Johnson
    Jul 30, 2012
  4. Steven Simpson
    Replies:
    0
    Views:
    157
    Steven Simpson
    Jul 30, 2012
  5. Knute Johnson
    Replies:
    0
    Views:
    156
    Knute Johnson
    Jul 31, 2012
Loading...

Share This Page