Skip to content

Commit df4d89c

Browse files
committed
add proxy settings
1 parent 943e923 commit df4d89c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/Browser/BrowserConfig.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ internal static class BrowserConfig {
2525
public static bool WebGL = true;
2626
public static bool ApplicationCache = true;
2727

28-
28+
public static bool Proxy = false;
29+
public static string ProxyIP = "123.123.123.123";
30+
public static int ProxyPort = 123;
31+
public static string ProxyUsername = "username";
32+
public static string ProxyPassword = "pass";
33+
public static string ProxyBypassList = "";
2934

3035
}
3136
}

src/MainForm.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ private void InitBrowser() {
159159

160160
settings.CachePath = GetAppDir("Cache");
161161

162+
if (BrowserConfig.Proxy) {
163+
CefSharpSettings.Proxy = new ProxyOptions(BrowserConfig.ProxyIP,
164+
BrowserConfig.ProxyPort.ToString(), BrowserConfig.ProxyUsername,
165+
BrowserConfig.ProxyPassword, BrowserConfig.ProxyBypassList);
166+
}
167+
162168
Cef.Initialize(settings);
163169

164170
dHandler = new DownloadHandler(this);

0 commit comments

Comments
 (0)