Custom low-level network functionality

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Custom low-level network functionality

Postby ben » Mon May 29, 2017 9:49 am

I want to use CEF to build a very basic Webviewer that should be able to load and display webpages.
The low level network access however is very specific. Because of sandbox restrictions this Webviewer cannot open his own TCP/UDP-sockets but gets them handed by a network blackbox. Whenever the user opens a new URL the Webviewer has to ask this network blackbox for permissions and then gets the necessary sockets handed to him. The open sockets get sent via a unix domain socket.

Q:
In which files of the CEF repository can I find the low-level-network stuff? I haven't found anything in the libcef/browser/net folder.
Q:
Is there a way to overwrite the default network access functions without compromising high-level functions like LoadURL()? I still want to be able to use the "normal" request functions, but only with my custom functions underneath?

Environment:
Fedora 25

Thanks for all your help! Sorry if the questions are trivial, I'm new to the project ;)
ben
Newbie
 
Posts: 5
Joined: Mon May 29, 2017 8:52 am

Re: Custom low-level network functionality

Postby magreenblatt » Mon May 29, 2017 10:14 am

You would need to implement this functionality in Chromium (src/net code). I suggest you start by downloading/building Chromium from source code and reviewing the code in that directory. If you have any specific questions you can ask on Chromium's net-dev mailing list.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Custom low-level network functionality

Postby amaitland » Mon May 29, 2017 3:59 pm

What about implementing a scheme handler? You can register for http and HTTPS, intercepting every request, make your custom requests and populate the response stream when your done.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: Custom low-level network functionality

Postby Czarek » Tue May 30, 2017 1:14 am

You can control requests by implementing CefRequestHandler::GetResourceHandler. Use CefURLRequest/CefURLRequestClient to perform the requests.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Custom low-level network functionality

Postby ben » Wed Jul 12, 2017 8:31 am

After some fiddling with a custom scheme handler I wonder if CEF provides any callbacks to hook into the socket setup process of chromium?
Are there any callbacks you can register to that are called when CEF opens a socket?

IMHO, modifying the Chromium source code seems a bit overkill for such a task.
ben
Newbie
 
Posts: 5
Joined: Mon May 29, 2017 8:52 am

Re: Custom low-level network functionality

Postby magreenblatt » Wed Jul 12, 2017 10:59 am

ben wrote:After some fiddling with a custom scheme handler I wonder if CEF provides any callbacks to hook into the socket setup process of chromium?
Are there any callbacks you can register to that are called when CEF opens a socket?

IMHO, modifying the Chromium source code seems a bit overkill for such a task.

No such callbacks exist.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 24 guests

cron