Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

How to set proxy settings ... especially tor network

Chinyaev
Posts: 38
Joined: Mon Mar 13, 2017 3:23 pm

Re: How to set proxy settings ... especially tor network

Post by Chinyaev »

You need call Chromium.UpdatePreferences after set proxy.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to set proxy settings ... especially tor network

Post by salvadordf »

Hi,

I thought it wasn't possible to use the Tor network from a CEF based browser until I found this while searching for some background info to give you an answer :

https://www.codeproject.com/Articles/10 ... or-Browser

If you use the same kind of proxy to connect to the Tor network you would have to use these settings :

Code: Select all

TChromium.ProxyType := CEF_PROXYTYPE_FIXED_SERVERS;
TChromium.ProxyServer := '127.0.0.1';
TChromium.ProxyPort := 8182;
After setting the TChromium properties you can call TChromium.UpdatePreferences as Chinyaev said.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to set proxy settings ... especially tor network

Post by salvadordf »

You only need to add socks5:// to the sever address. It would be like this :

Code: Select all

TChromium.ProxyType := CEF_PROXYTYPE_FIXED_SERVERS;
TChromium.ProxyServer := 'socks5://127.0.0.1';
TChromium.ProxyPort := 8182;
For more details read this :
https://bitbucket.org/chromiumembedded/ ... resolution
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to set proxy settings ... especially tor network

Post by salvadordf »

Hi,

Try this :

Code: Select all

   Chromium.ProxyType := CEF_PROXYTYPE_FIXED_SERVERS;
   Chromium.ProxyServer := 'socks5://127.0.0.1';   // <--- just the scheme and server address. 
   Chromium.ProxyPort := 9050;
   Chromium.UpdatePreferences;
I'm just "guessing" how it should be done because I don't have that proxy.

Is it available for free ?
Can you give a download link ?
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to set proxy settings ... especially tor network

Post by salvadordf »

Hi,

I've updated CEF4Delphi and now the MiniBrowser demo can select SOCKS proxy servers in the preferences :
https://www.briskbard.com/forum/viewtopic.php?f=8&t=247

I've tested a couple of SOCKS5 servers successfully.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to set proxy settings ... especially tor network

Post by salvadordf »

Hi,

I'm afraid I can't do much more.

CEF4Delphi is just a CEF3 wrapper which includes Chromium. I can fix CEF4Delphi bugs but if there is a problem in CEF3 or Chromium we can only report the problem to the CEF3 project or to the Chromium project.

As far as I know, there's no way to change that timeout interval. It's buried in Chromium's code and it seems Google is ignoring these requests.

Read this from the official CEF3 forum :
http://magpcss.org/ceforum/viewtopic.php?f=6&t=13080

If possible, try configuring Tor to select a faster route.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to set proxy settings ... especially tor network

Post by salvadordf »

Set TChromium.Options.ImageLoading to STATE_DISABLED

You can also use the TChromium.OnBeforeResourceLoad event and set Result to RV_CANCEL to cancel the request for the resources you don't want to load.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to set proxy settings ... especially tor network

Post by salvadordf »

I forgot to mention that you should set TChromium.Options.ImageLoading before calling TChromium.CreateBrowser
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to set proxy settings ... especially tor network

Post by salvadordf »

This web page has a list of command line switches for Chromium. Not all of them work in CEF based applications but it's worth a try :
https://peter.sh/experiments/chromium-c ... -switches/

Use the GlobalCEFApp.AddCustomCommandLine function before the GlobalCEFApp.StartMainProcess call to test them.

For example GlobalCEFApp.AddCustomCommandLine('--show-fps-counter'); will show an FPS counter in the browser.

Some of those switches are related to the proxy servers, networking, etc.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to set proxy settings ... especially tor network

Post by salvadordf »

Same to you! :D

Happy new year from Spain!
Salvado Diaz
Post Reply