Thursday, June 14, 2012

Configure Proxy server bypass or pass

When you work in enterprise environment, you will most likely need to use proxy server either you like or not.

I have suffered for long time because proxy setting and I had to have customized proxy bypass script due to development.

I would like to share my snippet. I hope it helps.

Ubuntu apt-get Proxy configuration. For more detail




Maven test proxy setting



Eclipse proxy set up for JRE/JDK



Eclipse Network Proxy configuration for installing new sofware or update plugins



Eclipse Tomcat proxy set up
add below text
 -Dhttp.proxyHost="106.101.91.4" -Dhttp.proxyPort="8080" -Dhttps.proxyHost="106.101.91.4" -Dhttps.proxyPort="8080"



Internet Explorer Proxy configuration



Eclipse Java application Proxy configuration



Ubuntu Proxy for chrome browser



Firefox Proxy configuration



Proxy Automate Script(PAC) sample

/*************************
Configuration Example path

For IE on Windows
file://d:\proxy.pac

For FF on Windows
file:///d://proxy.pac

For FF on Ubuntu
file:///home/proxy.pac
*************************/
var PROXY1 = "PROXY 123.123.123.1:8080";
var PROXYY2 = "PROXY 123.123.123.2:8080";

var DIRECT = "DIRECT";
var regexpr_facebook = /^[.a-zA-Z0-9-]*.facebook.com/;
var myip = myIpAddress();

//url = http://www.yahoo.com/dkdkd/allld.jpg
//host = www.yahoo.com
function FindProxyForURL(url, host){

 //For Home AP access ( If Source IP starts with 192.168.x.x) bypass Proxy
 if (isInNet(myip, "192.168.0.0", "255.255.0.0")) {
  return DIRECT;
 //your local computer bypass Proxy
 }else if (isInNet(host, "127.0.0.1", "255.255.255.0") || host=="localhost") {
  return DIRECT;
 //C class subnet mask by pass Proxy(it means all IPs starts with 111.111.111 will bypass
 }else if (isInNet(host, "111.111.111.xxx", "255.255.255.0") ) {
  return DIRECT;
 //When you need to access from host file definition IPs
 }else if (host=="devsite"|| host=="mytest") {
  return DIRECT;
 //if you need proxy for specific ip ranges ( Domain will be resolved by DNS ang get IP)
 }else if (isInNet(myip, "106.101.7.93", "255.255.255.0") ) {
  return PROXY1;
 //if you need proxy for specific domain address
 }else if (regexpr_facebook.test(host)){
  return PROXYY2;
 }else{
  return PROXY1;
 }
}

2 comments:

  1. If you wanna access blocked torrent site then check this short method to access without any long methods.
    Fenopy UK proxy

    ReplyDelete
  2. Your detailed blog is very good. Keep doing this work.
    torrentHound UK proxy

    ReplyDelete