Search in sources :

Example 1 with Socks5RequestFirewallRules

use of com.github.jh3nd3rs0n.jargyle.server.rules.impl.Socks5RequestFirewallRules in project jargyle by jh3nd3rs0n.

the class Socks5Worker method canAllowSocks5Request.

private boolean canAllowSocks5Request(final FirewallRule.Context context) {
    Socks5RequestFirewallRules socks5RequestFirewallRules = this.settings.getLastValue(Socks5SettingSpecConstants.SOCKS5_SOCKS5_REQUEST_FIREWALL_RULES);
    socks5RequestFirewallRules.applyTo(context);
    if (FirewallRuleAction.ALLOW.equals(context.getFirewallRuleAction())) {
        return true;
    }
    Socks5Reply socks5Rep = Socks5Reply.newFailureInstance(Reply.CONNECTION_NOT_ALLOWED_BY_RULESET);
    this.socks5WorkerContext.sendSocks5Reply(this, socks5Rep, LOGGER);
    return false;
}
Also used : Socks5Reply(com.github.jh3nd3rs0n.jargyle.transport.socks5.Socks5Reply) Socks5RequestFirewallRules(com.github.jh3nd3rs0n.jargyle.server.rules.impl.Socks5RequestFirewallRules)

Aggregations

Socks5RequestFirewallRules (com.github.jh3nd3rs0n.jargyle.server.rules.impl.Socks5RequestFirewallRules)1 Socks5Reply (com.github.jh3nd3rs0n.jargyle.transport.socks5.Socks5Reply)1