CefSharp 3 set proxy at Runtime

thanks to amaitland the proper way to actively inforce changing the request-context prefrences, is to run the code on CEF UIThread as following: Cef.UIThreadTaskFactory.StartNew(delegate { var rc = this.browser.GetBrowser().GetHost().RequestContext; var v = new Dictionary<string, object>(); v[“mode”] = “fixed_servers”; v[“server”] = “scheme://host:port”; string error; bool success = rc.SetPreference(“proxy”, v, out error); //success=true,error=”” });

How to call a user defined Matlab from Java using matlabcontrol.jar

You must have any user-defined m-files on the MATLAB search path, just as if you were working normally inside MATLAB. I tested with the following example: C:\some\path\myfunc.m function myfunc() disp(‘hello from MYFUNC’) end HelloWorld.java import matlabcontrol.*; public class HelloWorld { public static void main(String[] args) throws MatlabConnectionException, MatlabInvocationException { // create proxy MatlabProxyFactoryOptions options = … Read more

How to set proxy authentication in PhantomJS using selenium?

PhantomJS uses the three proxy options that are set from the commandline (docs). –proxy=address:port specifies the proxy server to use (e.g. –proxy=192.168.1.42:8080). –proxy-type=[http|socks5|none] specifies the type of the proxy server (default is http). –proxy-auth specifies the authentication information for the proxy, e.g. –proxy-auth=username:password). To use these, you have to add them to the DesiredCapabilities map … Read more

HTTP Headers: Controlling Cache and History Mechanism

I’ll answer my own question: Static public content Date: <current time> Expires: <current time + one year> Rationale: This is compatible with the HTTP/1.0 proxies and RFC 2616 Section 14: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21 The Last-Modified header is not needed for correct caching (because conforming user agents follow the Expires header) but may be included for the end … Read more

Proxy: Selenium + Python, Firefox

You need to import the following: from selenium.webdriver.common.proxy import Proxy, ProxyType Then setup the proxies: myProxy = “xx.xx.xx.xx:xxxx” proxy = Proxy({ ‘proxyType’: ProxyType.MANUAL, ‘httpProxy’: myProxy, ‘ftpProxy’: myProxy, ‘sslProxy’: myProxy, ‘noProxy’: ” # set this value as desired }) Then call the webdriver.Firefox() function as follows: driver = webdriver.Firefox(proxy=proxy) driver.get(“http://www.google.com”) Don’t remember where exactly I found … Read more

How to use an HTTP proxy in java

You can use the java system properties to set up a proxy or pass it as command line options. You can find some details and samples here. Ex: Before opening the connection System.setProperty(“http.proxyHost”, “myProxyServer.com”); System.setProperty(“http.proxyPort”, “80”); Or you can use the default network proxies configured in the sytem System.setProperty(“java.net.useSystemProxies”, “true”); Since Java 1.5 you can … Read more