Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix hostname issue

  • Loading branch information...
commit 22feee4ebf78275389bd58e18d8eed4c95084d6a 1 parent 187b871
@brunogh authored
Showing with 10 additions and 5 deletions.
  1. +7 −3 README.rdoc
  2. +1 −0  Rakefile
  3. +1 −1  VERSION
  4. +1 −1  lib/tor/http.rb
View
10 README.rdoc
@@ -4,19 +4,23 @@
* Download at https://www.torproject.org
* Start Tor
-* You can change port configuration following On Settings -> Advanced -> Fix the port to 9051
+* You can change port configuration by clicking on Settings -> Advanced -> Adjust the port to 9050
2 - Ruby code
- res = Tor::HTTP.get("google.com", 80, "/")
+ res = Tor::HTTP.get("google.com", "/", 80)
p res.code
p res.body
OR
res = Tor::HTTP.get("google.com")
+
+OR
+
+ res = Tor::HTTP.get(URI('http://google.com/'))
-Default configuration is port 9050 and ip 127.0.0.1. If you need to change configuration, you can call:
+The default port configuration is 9050 and ip configuration is 127.0.0.1. If you need to change configuration, you can use:
Tor.configure do |config|
config.ip = "127.0.0.1"
View
1  Rakefile
@@ -22,6 +22,7 @@ Jeweler::Tasks.new do |gem|
gem.email = "brunogh@gmail.com"
gem.authors = ["Bruno Ghisi"]
# dependencies defined in Gemfile
+ gem.add_dependency 'socksify'
end
Jeweler::RubygemsDotOrgTasks.new
View
2  VERSION
@@ -1 +1 @@
-0.2.0
+0.3.0
View
2  lib/tor/http.rb
@@ -11,7 +11,7 @@ def self.get(uri_or_host, path = nil, port = nil)
if path
host = uri_or_host
else
- host = uri_or_host.hostname
+ host = uri_or_host.host
port = uri_or_host.port
end
Net::HTTP.SOCKSProxy(Tor.configuration.ip, Tor.configuration.port).start(host, port) do |http|
Please sign in to comment.
Something went wrong with that request. Please try again.