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
socketThe accepted socket.
-
GCDAsyncSocket delegate callback.
Warning
Do not call this method. This should be marked private but have to be marked public since the
GCDAsyncSocketDelegateis public.Declaration
Swift
open func socket(_ sock: GCDAsyncSocket, didAcceptNewSocket newSocket: GCDAsyncSocket)Parameters
sockThe listening GCDAsyncSocket.
newSocketThe accepted new GCDAsyncSocket.
-
Undocumented
Declaration
Swift
open class GCDProxyServer: ProxyServer, GCDAsyncSocketDelegate
View on GitHub
GCDProxyServer Class Reference