Open tigris opened 12 years ago
Propose an API.
Then it won't be a long shot for a commit.
@tigris socksify-ruby can do this, altough interface is ugly a bit. It's kind of undocumented feature.
require 'socksify'
addr = TCPSocket::SOCKSConnectionPeerAddress.new("<socks host>", <socks port>, "<peer host>")
s = TCPSocket.new(addr, <peer port>)
# Proceed as usual.
Something like this would be nice:
require 'socksify'
# Create a new socksified connection
socksified_connection = Socksify::Connection.new(socks_host: "<socks host>", socks_port: <socks port>, peer_host: "<peer host>", peer_port: <peer port>)
# Use the connection as a regular TCPSocket
socksified_connection.write("data")
response = socksified_connection.read
socksified_connection.close
Would love if this could be threadsafe, often want a few tcp sockets open at same time, some via socks and some not