Class HAProxyConnectionInitEvent
java.lang.Object
net.md_5.bungee.api.plugin.Event
net.md_5.bungee.api.event.AsyncEvent<HAProxyConnectionInitEvent>
com.mrivanplays.ivancord.api.event.HAProxyConnectionInitEvent
- All Implemented Interfaces:
Cancellable
public class HAProxyConnectionInitEvent
extends AsyncEvent<HAProxyConnectionInitEvent>
implements Cancellable
Event, called when the HAProxy message for a connection has been decoded.
This event is called even earlier than
ClientConnectEvent
and ConnectionInitEvent
, be
careful when handling it.
It is called only and ONLY if the proxy has received a HAProxy message about a specific client.
The reason this event exists is that both plain BungeeCord and Waterfall's events get called on a stage, where if the proxy is running behind a HAProxy, they will give the address of the HAProxy rather than the address of the client.
This event should only and ONLY be used for mitigating layer 7 DDoS attacks, and nothing else.
-
Constructor Summary
ConstructorDescriptionHAProxyConnectionInitEvent
(SocketAddress socketAddress, ListenerInfo listener, Callback<HAProxyConnectionInitEvent> done) -
Method Summary
Modifier and TypeMethodDescriptionThe listener that accepted the connection.Remote address of the connection.boolean
Cancelled statevoid
setCancelled
(boolean cancelled) Cancelled statetoString()
Methods inherited from class net.md_5.bungee.api.event.AsyncEvent
canEqual, completeIntent, equals, hashCode, postCall, registerIntent
-
Constructor Details
-
HAProxyConnectionInitEvent
public HAProxyConnectionInitEvent(SocketAddress socketAddress, ListenerInfo listener, Callback<HAProxyConnectionInitEvent> done)
-
-
Method Details
-
isCancelled
public boolean isCancelled()Cancelled state- Specified by:
isCancelled
in interfaceCancellable
- Returns:
- the cancelled state of this event
-
getSocketAddress
Remote address of the connection. -
getListener
The listener that accepted the connection. -
setCancelled
public void setCancelled(boolean cancelled) Cancelled state- Specified by:
setCancelled
in interfaceCancellable
- Parameters:
cancelled
- the state to set
-
toString
- Overrides:
toString
in classAsyncEvent<HAProxyConnectionInitEvent>
-