You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CHECK(!!GOOD_HOST_REGEX,"GOOD_HOST_REGEX is required");
38
+
39
+
constlistenHost=LISTEN_HOST;
40
+
constlistenPort=parseInt(LISTEN_PORT);
41
+
constgoodHostRegex=TRY(()=>newRegExp(GOOD_HOST_REGEX),"GOOD_HOST_REGEX must be a valid regular expression");
42
+
constgoodProxy=TRY(()=>newURL(GOOD_PROXY),"GOOD_PROXY must be a valid URL");
43
+
constbadProxy=TRY(()=>BAD_PROXY ? newURL(BAD_PROXY) : null,"BAD_PROXY must be a valid URL");
44
+
45
+
CHECK(listenPort>=0&&listenPort<=65535,"LISTEN_PORT must be a valid port number");
46
+
CHECK(!/(?<!\\)\./.test(goodHostRegex),"GOOD_HOST_REGEX contains unescaped dot (.) character(s) (aka. wildcards). Make sure this is intentional! If not, escape them with a backslash (\\)",true);
47
+
CHECK(/https?/.test(goodProxy.protocol),"GOOD_PROXY must be an HTTP or HTTPS proxy URL");
48
+
49
+
CHECK(badProxy!=null,"BAD_PROXY is missing. Using direct connection instead",true);
50
+
if(badProxy){
51
+
CHECK(/https?/.test(badProxy.protocol),"BAD_PROXY must be an HTTP or HTTPS proxy URL");
52
+
CHECK(badProxy.username||badProxy.password,"no authentication provided for BAD_PROXY. BAD_PROXY will be used without authentication",true);
0 commit comments