How can I set a proxy server for gem?

For http/https proxy with or without authentication: Run one of the following commands in cmd.exe set http_proxy=http://your_proxy:your_port set http_proxy=http://username:password@your_proxy:your_port set https_proxy=https://your_proxy:your_port set https_proxy=https://username:password@your_proxy:your_port

What is the difference between HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR?

Neither of these headers are officially standardised. Therefore: What is the difference between HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR? – it is impossible to say. Different proxies may implement these, or may not. The implementations may vary from one proxy to the next, and they may not. A lack of a standard breeds question marks. Why would one … Read more

How do I get the remote address of a client in servlet?

try this: public static String getClientIpAddr(HttpServletRequest request) { String ip = request.getHeader(“X-Forwarded-For”); if (ip == null || ip.length() == 0 || “unknown”.equalsIgnoreCase(ip)) { ip = request.getHeader(“Proxy-Client-IP”); } if (ip == null || ip.length() == 0 || “unknown”.equalsIgnoreCase(ip)) { ip = request.getHeader(“WL-Proxy-Client-IP”); } if (ip == null || ip.length() == 0 || “unknown”.equalsIgnoreCase(ip)) { ip = … Read more

file_get_contents behind a proxy?

To use file_get_contents() over/through a proxy that doesn’t require authentication, something like this should do : (I’m not able to test this one : my proxy requires an authentication) $aContext = array( ‘http’ => array( ‘proxy’ => ‘tcp://192.168.0.2:3128’, ‘request_fulluri’ => true, ), ); $cxContext = stream_context_create($aContext); $sFile = file_get_contents(“http://www.google.com”, False, $cxContext); echo $sFile; Of course, … Read more

npm behind a proxy fails with status 403

OK, so within minutes after posting the question, I found the answer myself here: https://github.com/npm/npm/issues/2119#issuecomment-5321857 The issue seems to be that npm is not that great with HTTPS over a proxy. Changing the registry URL from HTTPS to HTTP fixed it for me: npm config set registry http://registry.npmjs.org/ I still have to provide the proxy … Read more

Bower calls blocked by corporate proxy

Thanks @user3259967 This did the job. I would like to add that if you are behind a proxy that needs to be authenticated, you can add the username/password to your .bowerrc file. { “directory”: “library”, “registry”: “http://bower.herokuapp.com”, “proxy”:”http://<USERNAME>:<PASSWORD>@<PROXY_IP>:<PROXY_PORT>/”, “https-proxy”:”http://<USERNAME>:<PASSWORD>@<PROXY_IP>:<PROXY_PORT>/” } NOTICE the use of http:// in https-proxy

Only use a proxy for certain git urls/domains?

To add another possibility, you can define a proxy through the git config http.proxy. git config –global http.proxy http://mydomain\\myusername:mypassword@myproxyserver:proxyport But what is really neat is, starting git1.8.5 (October 2013), you can set http settings per url. The “http.*” variables can now be specified per URL that the configuration applies. For example, [http] sslVerify = true … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)