Running Selenium Webdriver with a proxy in Python

Works for me this way (similar to @Amey and @user4642224 code, but shorter a bit): from selenium import webdriver from selenium.webdriver.common.proxy import Proxy, ProxyType prox = Proxy() prox.proxy_type = ProxyType.MANUAL prox.http_proxy = “ip_addr:port” prox.socks_proxy = “ip_addr:port” prox.ssl_proxy = “ip_addr:port” capabilities = webdriver.DesiredCapabilities.CHROME prox.add_to_capabilities(capabilities) driver = webdriver.Chrome(desired_capabilities=capabilities)

WebView android proxy

I have adapted the three solutions presented here (and modified one where it failed) to produce a single, simple setProxy method that works for all versions of Android. I’ve tested it from 10 to 18, and it works for all tested environments. UPDATED 2014-04-04 I finally worked in the solution from a comment below, courtesy … Read more

Cannot download Docker images behind a proxy

Here is a link to the official Docker documentation for proxy HTTP: https://docs.docker.com/config/daemon/systemd/#httphttps-proxy A quick outline: First, create a systemd drop-in directory for the Docker service: mkdir /etc/systemd/system/docker.service.d Now create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY and HTTPS_PROXY environment variables: [Service] Environment=”HTTP_PROXY=http://proxy.example.com:80/” Environment=”HTTPS_PROXY=http://proxy.example.com:80/” If you have internal Docker registries that you need to … Read more

How to convert a Hibernate proxy to a real entity object

Here’s a method I’m using. public static <T> T initializeAndUnproxy(T entity) { if (entity == null) { throw new NullPointerException(“Entity passed for initialization is null”); } Hibernate.initialize(entity); if (entity instanceof HibernateProxy) { entity = (T) ((HibernateProxy) entity).getHibernateLazyInitializer() .getImplementation(); } return entity; }

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

How do I set the proxy to be used by the JVM

From the Java documentation (not the javadoc API): http://download.oracle.com/javase/6/docs/technotes/guides/net/proxies.html Set the JVM flags http.proxyHost and http.proxyPort when starting your JVM on the command line. This is usually done in a shell script (in Unix) or bat file (in Windows). Here’s the example with the Unix shell script: JAVA_FLAGS=-Dhttp.proxyHost=10.0.0.100 -Dhttp.proxyPort=8800 java ${JAVA_FLAGS} … When using containers … Read more

Getting Git to work with a proxy server – fails with “Request timed out”

Command to use: git config –global http.proxy http://proxyuser:[email protected]:8080 change proxyuser to your proxy user change proxypwd to your proxy password change proxy.server.com to the URL of your proxy server change 8080 to the proxy port configured on your proxy server Note that this works for both http and https repos. If you decide at any … Read more