@@ -118,6 +118,12 @@ Global $g_iOutputPollInterval = Int(IniReadWrite($CONFIG_INI, "proxallium", "out
118118
119119Global $g_sTorConfig_Port = IniReadWrite($CONFIG_INI , " tor_config" , " port" , " 9050" )
120120Global $g_bTorConfig_OnlyLocalhost = (IniReadWrite($CONFIG_INI , " tor_config" , " localhost_only" , " true" ) = " true" )
121+
122+ Global $g_sTorConfig_ProxyType = IniRead ($CONFIG_INI , " proxy" , " type" , " " )
123+ Global $g_sTorConfig_ProxyHost = IniRead ($CONFIG_INI , " proxy" , " host" , " " )
124+ Global $g_sTorConfig_ProxyPort = IniRead ($CONFIG_INI , " proxy" , " port" , " " )
125+ Global $g_sTorConfig_ProxyUser = IniRead ($CONFIG_INI , " proxy" , " user" , " " )
126+ Global $g_sTorConfig_ProxyPass = IniRead ($CONFIG_INI , " proxy" , " pass" , " " )
121127#EndRegion Read Configuration
122128
123129If Not FileExists ($g_sTorConfigFile ) Then
@@ -272,6 +278,40 @@ Func Core_GenTorrc()
272278 FileWriteLine ($hTorrc , ' ## Data Directory' )
273279 FileWriteLine ($hTorrc , ' DataDirectory ' & $g_sTorDataDirPath )
274280 FileWriteLine ($hTorrc , " " )
281+ If Not $g_sTorConfig_ProxyType = " " Then
282+ FileWriteLine ($hTorrc , " ## Proxy Settings for Tor (not Tor's proxy settings)" )
283+ Local $sProxySettings
284+ Switch $g_sTorConfig_ProxyType
285+ Case " http"
286+ $sProxySettings &= " HTTPProxy " & $g_sTorConfig_ProxyHost
287+ $sProxySettings &= ($g_sTorConfig_ProxyPort = " " ) ? " " : (' :' & $g_sTorConfig_ProxyPort )
288+ $sProxySettings &= @CRLF
289+ If Not $g_sTorConfig_ProxyUser = " " Then $sProxySettings &= " HTTPProxyAuthenticator " & $g_sTorConfig_ProxyUser & ' :' & $g_sTorConfig_ProxyPass & @CRLF
290+
291+ Case " https"
292+ $sProxySettings &= " HTTPSProxy " & $g_sTorConfig_ProxyHost
293+ $sProxySettings &= ($g_sTorConfig_ProxyPort = " " ) ? " " : (' :' & $g_sTorConfig_ProxyPort )
294+ $sProxySettings &= @CRLF
295+ If Not $g_sTorConfig_ProxyUser = " " Then $sProxySettings &= " HTTPSProxyAuthenticator " & $g_sTorConfig_ProxyUser & ' :' & $g_sTorConfig_ProxyPass & @CRLF
296+
297+ Case " socks4"
298+ $sProxySettings &= " Socks4Proxy " & $g_sTorConfig_ProxyHost
299+ $sProxySettings &= ($g_sTorConfig_ProxyPort = " " ) ? " " : (' :' & $g_sTorConfig_ProxyPort )
300+ $sProxySettings &= @CRLF
301+
302+ Case " socks5"
303+ $sProxySettings &= " Socks5Proxy " & $g_sTorConfig_ProxyHost
304+ $sProxySettings &= ($g_sTorConfig_ProxyPort = " " ) ? " " : (' :' & $g_sTorConfig_ProxyPort )
305+ $sProxySettings &= @CRLF
306+ If Not $g_sTorConfig_ProxyUser = " " Then $sProxySettings &= " Socks5ProxyUsername " & $g_sTorConfig_ProxyUser & @CRLF
307+ If Not $g_sTorConfig_ProxyPass = " " Then $sProxySettings &= " Socks5ProxyPassword " & $g_sTorConfig_ProxyPass & @CRLF
308+
309+ Case Else
310+ $sProxySettings &= ' ## Unknown proxy type detected!? Cannot generate config :('
311+ EndSwitch
312+ FileWriteLine ($hTorrc , $sProxySettings )
313+ FileWriteLine ($hTorrc , " " )
314+ EndIf
275315 FileWriteLine ($hTorrc , ' ###########################################################' )
276316 FileWriteLine ($hTorrc , ' ###### STORE YOUR CUSTOM CONFIGURATION ENTRIES BELOW ######' )
277317 FileWriteLine ($hTorrc , ' ##### THEY WILL BE PRESERVED ACROSS CHANGES IN CONFIG #####' )
0 commit comments