Skip to content

Typo in TransparentProxyServer ctor #47

@zbalkan

Description

@zbalkan

The TransparentProxyServer constructor does not validate the parameter but the field which always have the default value, invalidating the guard clauses.

public TransparentProxyServer(IPEndPoint localEP, IProxyServerConnectionManager connectionManager = null, TransparentProxyServerMethod method = TransparentProxyServerMethod.DNAT, int backlog = 10)
{
if (_method != TransparentProxyServerMethod.Tunnel)
{
if (Environment.OSVersion.Platform != PlatformID.Unix)
throw new NotSupportedException("Only Unix/Linux is supported.");
if ((method == TransparentProxyServerMethod.DNAT) && (localEP.AddressFamily != AddressFamily.InterNetwork))
throw new NotSupportedException("Only IPv4 is supported with DNAT.");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions