Skip to content

Commit

Permalink
Add support for configuring HttpTunnelPort for Tor
Browse files Browse the repository at this point in the history
  • Loading branch information
kzu committed May 20, 2021
1 parent 96f1959 commit 67b6bed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/TorSharp/Tools/Tor/TorConfigurationDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public IDictionary<string, List<string>> GetDictionary(Tool tool, TorSharpSettin
{
{ "ControlPort", settings.TorSettings.ControlPort.ToString(CultureInfo.InvariantCulture) }
};

if (settings.TorSettings.HttpTunnelPort != 0)
{
dictionary["HTTPTunnelPort"] = settings.TorSettings.HttpTunnelPort.ToString(CultureInfo.InvariantCulture);
}

if (settings.TorSettings.UseBridges.HasValue)
{
Expand Down
6 changes: 6 additions & 0 deletions src/TorSharp/TorSharpTorSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ public TorSharpTorSettings()
/// </summary>
public int SocksPort { get; set; }

/// <summary>
/// The port that Tor listens to for HTTP, to use Tor directly as an HTTP proxy, instead of using Privoxy.
/// See https://2019.www.torproject.org/docs/tor-manual.html.en#HTTPTunnelPort for details.
/// </summary>
public int HttpTunnelPort { get; set; }

/// <summary>
/// Additional ports that Tor listens to for SOCKS. These ports are not used by Privoxy but can be used for
/// other purposes. Defaults to an empty list.
Expand Down

0 comments on commit 67b6bed

Please sign in to comment.