Skip to content

Commit

Permalink
now accept command options to specify the proxy ports
Browse files Browse the repository at this point in the history
  • Loading branch information
jugyo committed Mar 7, 2012
1 parent dcfc04e commit 7418de9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@ Installation
Run
---

$ tunnels
$ sudo tunnels

or
By default, proxy to 80 port from 443 port.

$ sudo tunnels
specify `http` port:

$ sudo tunnels 4567

specify `http` port and `https` port:

$ sudo tunnels 4567 443

Copyright
---------
Expand Down
2 changes: 1 addition & 1 deletion bin/tunnels
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
require 'tunnels'
Tunnels.run!
Tunnels.run!('127.0.0.1', *ARGV[0..1])
2 changes: 1 addition & 1 deletion lib/tunnels.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Copyright © 2012, Thin::Glazed was a Rails Camp New Zealand project, and is developed and maintained by Pat Allan. It is released under the open MIT Licence.

module Tunnels
def self.run!(host = '127.0.0.1', from = 443, to = 80)
def self.run!(host = '127.0.0.1', to = 80, from = 443)
EventMachine.run do
EventMachine.start_server(host, from, HttpsProxy, to)
puts "Ready :)"
Expand Down

0 comments on commit 7418de9

Please sign in to comment.