GCDProxyServer
open class GCDProxyServer: ProxyServer, GCDAsyncSocketDelegate
Proxy server which listens on some port by GCDAsyncSocket.
This shoule be the base class for any concrete implementation of proxy server (e.g., HTTP or SOCKS5) which needs to listen on some port.
-
Start the proxy server which creates a GCDAsyncSocket listening on specific port.
Throws
The error occured when starting the proxy server.Declaration
Swift
override open func start() throws
-
Stop the proxy server.
Declaration
Swift
override open func stop()
-
Delegate method to handle the newly accepted GCDTCPSocket.
Only this method should be overrided in any concrete implementation of proxy server which listens on some port with GCDAsyncSocket.
Declaration
Swift
func handleNewGCDSocket(_ socket: GCDTCPSocket)
Parameters
socket
The accepted socket.
-
GCDAsyncSocket delegate callback.
Warning
Do not call this method. This should be marked private but have to be marked public since the
GCDAsyncSocketDelegate
is public.Declaration
Swift
open func socket(_ sock: GCDAsyncSocket, didAcceptNewSocket newSocket: GCDAsyncSocket)
Parameters
sock
The listening GCDAsyncSocket.
newSocket
The accepted new GCDAsyncSocket.
-
Undocumented
Declaration
Swift
open class GCDProxyServer: ProxyServer, GCDAsyncSocketDelegate