0

12hours of searching :( Im trying to run chromium(cef) browser from specific ethernet but no luck to find specific answer hope someone help me, thanks in advance

i tried these code

ChromiumWebBrowser chrome;

var frame = chrome.GetMainFrame();
var request = frame.CreateRequest(initializePostData:true);

HttpWebRequest httpRequest = (HttpWebRequest)request;
httpRequest.ServicePoint.BindIPEndPointDelegate =
    new BindIPEndPoint(BindIPEndPointCallback);

...

private static IPEndPoint BindIPEndPointCallback(ServicePoint servicePoint,
                                                    IPEndPoint remoteEndPoint,
                                                    int retryCount)
{
    if (remoteEndPoint.AddressFamily == AddressFamily.InterNetwork)
    {
        return new IPEndPoint(IPAddress.Parse("192.168.16.100"), 0);
    }
    // Just use the default endpoint.
    return null;
}


but it doesnt work and error

just combine codes from these links

https://github.com/cefsharp/CefSharp/blob/cd934267c65f494ceb9ee75995cd2a1ca0954543/CefSharp.Wpf.Example/ViewModels/BrowserTabViewModel.cs#L213

...

Choose one of many Internet connections for an application

...

i found similar question but did not get right answer from this CefSharp choose local end point

  • The request object returned from CreateRequest is not a HttpWebRequest. Fundamentally CEF doesn't support what you are attempting. You'd be better off trying to find a proxy server you can run locally (maybe titanium web proxy, not sure if it supports specifying an interface) and telling the browser to use the proxy. – amaitland Feb 16 '22 at 20:28
  • @amaitland do you have alternative i could use, i tried forcebindip but it doesnt work anymore and tried it on other browser , chrome, firefox, ie, edge – terdexx pogi Feb 17 '22 at 01:18
  • Proxy is my suggestion – amaitland Feb 17 '22 at 01:26

0 Answers0