Sha256: cf9e6ad6641bbadb833a4d8519b8ec04a27104921b2c5e88b7c0c908a09a334e
Contents?: true
Size: 552 Bytes
Versions: 33
Compression:
Stored size: 552 Bytes
Contents
#!/usr/bin/env ruby require 'pry' require 'proxy_pac_rb' string = <<-EOS function FindProxyForURL(url, host) { if ( myIpAddress() == '127.0.0.2' ) { return "DIRECT"; } else { return "PROXY localhost:8080"; } } EOS environment = ProxyPacRb::Environment.new(client_ip: '127.0.0.1') file = ProxyPacRb::Parser.new(environment).source(string) puts(file.find('http://localhost')) environment = ProxyPacRb::Environment.new(client_ip: '127.0.0.2') file = ProxyPacRb::Parser.new(environment).source(string) puts(file.find('http://localhost'))
Version data entries
33 entries across 33 versions & 1 rubygems