Sha256: 329565ccef2cc51526140a024c94e8c50c3c8f996a9ce4a8d0b36784e95bf803
Contents?: true
Size: 554 Bytes
Versions: 6
Compression:
Stored size: 554 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
6 entries across 6 versions & 1 rubygems