Class: VagrantPlugins::Proxy::Action::ConfigGuestIpTablesForProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-proxy/action/config_guest_iptables_for_proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ ConfigGuestIpTablesForProxy

Returns a new instance of ConfigGuestIpTablesForProxy.



6
7
8
9
10
# File 'lib/vagrant-proxy/action/config_guest_iptables_for_proxy.rb', line 6

def initialize(app, env)
  @app = app
  # Config#finalize! SHOULD be called automatically
  env[:global_config].omnibus.finalize!
end

Instance Method Details

#call(env) ⇒ Object

(2013-04-27 16:35:42) newgoliath: pastebin.com/D0McquR1 (2013-04-27 17:05:08) hanskreuger: sudo iptables -t nat -A PREROUTING -p tcp –dport 80 -j REDIRECT –to 3128 (2013-04-27 17:06:12) juliancdunn: s/3128/8123 (2013-04-27 17:19:59) juliancdunn: hanskreuger: is this helpful? www.tldp.org/HOWTO/TransparentProxy-6.html (2013-04-27 17:28:54) hanskreuger: sudo iptables -t nat -I OUTPUT –src 0/0 -p tcp –dport 80 -j DNAT –to 10.0.2.2:8123



19
20
21
22
23
24
25
26
# File 'lib/vagrant-proxy/action/config_guest_iptables_for_proxy.rb', line 19

def call(env)
  # foo = env[:global_config].proxy.foo

  env[:ui].info("Setting up iptables in guest for proxying... ")
  env[:ssh_run_command] = make_iptables_command(env[:global_config].proxy)

  @app.call(env)
end