Configuration.connectSOCKS()
Description
Appends a connectSOCKS filter to the current pipeline layout.
A connectSOCKS filter implements SOCKS protocol on the client side.
- INPUT - Data stream to send to the server via SOCKS.
- OUTPUT - Data stream received from the server via SOCKS.
- SUB-INPUT - Data stream to send to the server with a leading SOCKS connection request.
- SUB-OUTPUT - Data stream received from the server with a leading SOCKS connection response.
A connectSOCKS filter pumps its input Data stream into a newly created sub-pipeline, prepended by a SOCKS connection request. Its output is the Data stream coming out of the sub-pipeline, with the leading SOCKS connection response removed.
Syntax
pipy().pipeline().connectSOCKS(destination).to(subPipelineLayout)pipy().pipeline().connectSOCKS(() => getDestination()).to(subPipelineLayout)
Parameters
connectSOCKS(address)
address
The destination address to connect to, in form of "<host>:<port>", or a function that returns the destination.
Return Value
The same Configuration object.
Example
pipy().listen(8443).connectSOCKS('example.com:443', // the destination address we intend to connect to).to($=>$.connect('localhost:1080' // suppose we have a local SOCKS proxy on port 1080))