Class NetherNetHTTPSignaling.Builder

java.lang.Object
org.cloudburstmc.netty.channel.nethernet.signaling.NetherNetHTTPSignaling.Builder
Enclosing class:
NetherNetHTTPSignaling

public static class NetherNetHTTPSignaling.Builder extends Object
Builder for NetherNetHTTPSignaling.

The server is backed by one keystore for the TLS listener and another for the server identity used to sign SDP answers. Both must be PKCS12 files, and only the identity keystore is required.

  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setIdentityKeystore

      public NetherNetHTTPSignaling.Builder setIdentityKeystore(File identityKeystore)
      Sets the unprotected keystore holding the identity key. Required.
      Parameters:
      identityKeystore - PKCS12 keystore holding the EC P-384 identity key
      Returns:
      This builder
    • setIdentityKeystore

      public NetherNetHTTPSignaling.Builder setIdentityKeystore(File identityKeystore, String identityPassword)
      Sets the keystore holding the identity key used to sign SDP answers. Required.

      The key must be EC P-384, and its certificate CN is surfaced as the identity domain, so set it to something recognisable. Generate one with:

      
       keytool -genkeypair -alias identity -keyalg EC -groupname secp384r1 \
               -storetype PKCS12 -keystore identity.p12 -storepass changeit \
               -dname "CN=Your Server" -validity 3650
       
      Parameters:
      identityKeystore - PKCS12 keystore holding the EC P-384 identity key
      identityPassword - Password for identityKeystore, or "" if unprotected
      Returns:
      This builder
    • setHttpsKeystore

      public NetherNetHTTPSignaling.Builder setHttpsKeystore(File httpsKeystore)
      Sets the unprotected keystore holding the TLS certificate and key.
      Parameters:
      httpsKeystore - PKCS12 keystore holding the TLS certificate and key
      Returns:
      This builder
    • setHttpsKeystore

      public NetherNetHTTPSignaling.Builder setHttpsKeystore(File httpsKeystore, String httpsPassword)
      Sets the keystore holding the TLS certificate and key. If unset the server listens in plaintext.
      Parameters:
      httpsKeystore - PKCS12 keystore holding the TLS certificate and key
      httpsPassword - Password for httpsKeystore, or "" if unprotected
      Returns:
      This builder
    • setPlayerFilter

      Sets the filter consulted for each join once its identity has been validated. Defaults to allowing everyone.
      Parameters:
      playerFilter - The filter to consult
      Returns:
      This builder
    • setMotdProvider

      Sets the provider called for each status request. Defaults to NetherNetServerSignaling.PongData.DEFAULT.
      Parameters:
      motdProvider - The provider to call
      Returns:
      This builder
    • setMotd

      Sets a fixed MOTD to advertise for every status request.
      Parameters:
      motd - The MOTD to advertise
      Returns:
      This builder
    • build

      public NetherNetHTTPSignaling build()
      Builds the signalling instance.
      Returns:
      A new signalling instance
      Throws:
      IllegalStateException - If no identity keystore was set