Permalink
Browse files

make the proxy example accept any port

  • Loading branch information...
1 parent 93546f8 commit 259576c88089978871d804cd645ce05ed1a6730e @jonasschneider committed Jan 4, 2012
Showing with 13 additions and 5 deletions.
  1. +0 −5 examples/port_3000_proxy.rb
  2. +13 −0 examples/proxy.rb
@@ -1,5 +0,0 @@
-require "momentum"
-
-EM.run {
- Momentum.start(Momentum::Adapters::Proxy.new('localhost', 3000))
-}
View
@@ -0,0 +1,13 @@
+require "momentum"
+
+port = ARGV.shift.to_i
+
+if port.zero?
+ puts "usage: #{$0} <port_to_proxy>"
+ exit
+end
+
+EM.run do
+ Momentum.start(Momentum::Adapters::Proxy.new('localhost', port))
+ puts ">> Momentum running on 0.0.0.0:5555 proxying to localhost:#{port}"
+end

0 comments on commit 259576c

Please sign in to comment.