use of com.github.jh3nd3rs0n.jargyle.server.rules.impl.Socks5ReplyFirewallRules in project jargyle by jh3nd3rs0n.
the class Socks5RequestWorkerContext method canAllowSocks5Reply.
public final boolean canAllowSocks5Reply(final Object worker, final FirewallRule.Context context, final Logger logger) {
Socks5ReplyFirewallRules socks5ReplyFirewallRules = this.getSettings().getLastValue(Socks5SettingSpecConstants.SOCKS5_SOCKS5_REPLY_FIREWALL_RULES);
socks5ReplyFirewallRules.applyTo(context);
if (FirewallRuleAction.ALLOW.equals(context.getFirewallRuleAction())) {
return true;
}
Socks5Reply rep = Socks5Reply.newFailureInstance(Reply.CONNECTION_NOT_ALLOWED_BY_RULESET);
this.sendSocks5Reply(worker, rep, logger);
return false;
}
use of com.github.jh3nd3rs0n.jargyle.server.rules.impl.Socks5ReplyFirewallRules in project jargyle by jh3nd3rs0n.
the class BindCommandWorker method canAllowSecondSocks5Reply.
private boolean canAllowSecondSocks5Reply(final FirewallRule.Context context) {
Socks5ReplyFirewallRules socks5ReplyFirewallRules = this.settings.getLastValue(Socks5SettingSpecConstants.SOCKS5_ON_BIND_SECOND_SOCKS5_REPLY_FIREWALL_RULES);
socks5ReplyFirewallRules.applyTo(context);
if (FirewallRuleAction.ALLOW.equals(context.getFirewallRuleAction())) {
return true;
}
Socks5Reply rep = Socks5Reply.newFailureInstance(Reply.CONNECTION_NOT_ALLOWED_BY_RULESET);
this.commandWorkerContext.sendSocks5Reply(this, rep, LOGGER);
return false;
}
Aggregations