Class Jdk7HttpProxySocket

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class Jdk7HttpProxySocket
    extends java.net.Socket
    Socket wrapper that supports pre-Java8 HTTP CONNECT proxies
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.net.Proxy httpProxy  
    • Constructor Summary

      Constructors 
      Constructor Description
      Jdk7HttpProxySocket​(java.net.Proxy proxy)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void checkAndFlushProxyResponse()  
      void connect​(java.net.SocketAddress endpoint, int timeout)  
      private void connectHttpProxy​(java.net.SocketAddress endpoint, int timeout)  
      • Methods inherited from class java.net.Socket

        bind, close, connect, getChannel, getInetAddress, getInputStream, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getOption, getOutputStream, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setKeepAlive, setOOBInline, setOption, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setSoLinger, setSoTimeout, setTcpNoDelay, setTrafficClass, shutdownInput, shutdownOutput, supportedOptions, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • httpProxy

        private java.net.Proxy httpProxy
    • Constructor Detail

      • Jdk7HttpProxySocket

        public Jdk7HttpProxySocket​(java.net.Proxy proxy)
    • Method Detail

      • connect

        public void connect​(java.net.SocketAddress endpoint,
                            int timeout)
                     throws java.io.IOException
        Overrides:
        connect in class java.net.Socket
        Throws:
        java.io.IOException
      • connectHttpProxy

        private void connectHttpProxy​(java.net.SocketAddress endpoint,
                                      int timeout)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • checkAndFlushProxyResponse

        private void checkAndFlushProxyResponse()
                                         throws java.io.IOException
        Throws:
        java.io.IOException