Comments (6)
After the refactor in master this should not be hard to do at all.
The hardest part is writing the tests. It would need a test server in Ruby that it can run tests against, including failover. Or figure out a test setup we can run in Travis.
As a last resort we could mock/stub the low level calls for testing. I did find https://github.com/rascov/RubySOCKS that could help.
Any ideas on how we can test this, or do you have any Ruby examples?
from net_tcp_client.
As first step i want to rewrite tests on rspec.
i think we can use RubySOCKS server for testing
from net_tcp_client.
The re-factoring of master has settled down and we can now look at additional support such as SOCKSSocket
.
Do you have any thoughts on how we can specify the server host name in the Hash of options that is supplied to the initializer?
client = Net::TCPClient.new(servers: ['server1:2000', 'server2:2000'])
Should we specify the socks server for each "server"?
client = Net::TCPClient.new(servers: ['server1(proxy1:2340):2000', 'server2(proxy1:2340):2000'])
Or specify the Socks server for all servers?
client = Net::TCPClient.new(
servers: ['server1:2000', 'server2:2000'],
socks_server: 'proxy1:2340'
)
from net_tcp_client.
The following should now work, please test it and let me know if it works.
client = Net::TCPClient.new(
server: 'server1:2000',
proxy_server: 'proxy1:2340'
)
from net_tcp_client.
Hey @reidmorrison! Thank you for the awesome tool. know it's been 5 years and this has gone untested, but it doesn't work.
Can you think of an easy fix, without rewriting the server param implementation to split host and port?
With your example:
from /usr/local/rvm/gems/ruby-2.7.4/gems/net_tcp_client-2.2.0/lib/net/tcp_client/tcp_client.rb:564:in initialize'
If I require 'resolv-replace'
:
from /usr/local/rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/resolv-replace.rb:14:in rescue in getaddress'
Caused by Resolv::ResolvError: no address for 1.73.63.15:80
from /usr/local/rvm/rubies/ruby-2.7.4/lib/ruby/2.7.0/resolv.rb:94:in getaddress'```
from net_tcp_client.
Any takers to help create a pull request to solve the above issue?
from net_tcp_client.
Related Issues (9)
- SSL HOT 2
- problem with logger in 1.0.1 version HOT 4
- #closed? and #alive? raise exception if server is closed HOT 2
- Net::TCPClient#socket_write corrupts data on short writes HOT 7
- SSL+SNI: Set OpenSSL::SSL::SSLSocket#hostname for shared hosts HOT 1
- send() results in NoMethodError HOT 1
- Reading arbitrary number of bytes? (Whois client) HOT 4
- ArgumentError with Ruby 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from net_tcp_client.