Class IceProxyProtocol

java.lang.Object
org.cloudburstmc.netty.util.nethernet.IceProxyProtocol
All Implemented Interfaces:
AutoCloseable

public final class IceProxyProtocol extends Object implements AutoCloseable
PROXY protocol v2 relays read on a shared ICE UDP port until closed, so their datagrams count as coming from the client each header declares. The setting belongs to the port, which reads the relays of every open handle, so built-in signaling and an NXS listener on one port each keep theirs until they close.
  • Method Details

    • set

      public static @Nullable IceProxyProtocol set(@Nullable InetAddress bindAddress, int port, IpRangeSet relays)
      Parameters:
      bindAddress - The address the port's peers bind, null for peers that leave it unset
      port - The fixed ICE port
      relays - The relays to read headers from
      Returns:
      A handle that removes the relays, or null when there are none
    • relayOf

      public @Nullable InetSocketAddress relayOf(InetSocketAddress client)
      The relay a client comes through on this port, by the address its header declared.
      Returns:
      The relay, or null when none speaks for the client
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable