Class ConnectionRequests

java.lang.Object
org.geysermc.geyser.network.ConnectionRequests

public final class ConnectionRequests extends Object
The pre-authentication gate every inbound connection passes, whichever transport carried it.
  • Method Details

    • accept

      public static boolean accept(GeyserImpl geyser, InetSocketAddress clientAddress, @Nullable InetSocketAddress proxyAddress)
      Fires ConnectionRequestEvent and reports whether the connection may proceed.

      Extensions use this to refuse a peer by address, before any session exists, so every transport has to ask before it creates one.

      Parameters:
      geyser - The running instance
      clientAddress - The address the connection came from
      proxyAddress - The proxy that forwarded it, or null when the transport has no proxy support
      Returns:
      true when the connection may proceed
    • accept

      public static boolean accept(GeyserImpl geyser, InetSocketAddress clientAddress, @Nullable InetSocketAddress proxyAddress, @Nullable String source)
      As accept(GeyserImpl, InetSocketAddress, InetSocketAddress), naming where the transport learned the address in the debug line.
      Parameters:
      source - Where the address came from, or null when the transport has only the one kind