Class NetherNetHTTPSignaling.Builder
java.lang.Object
org.cloudburstmc.netty.channel.nethernet.signaling.NetherNetHTTPSignaling.Builder
- Enclosing class:
- NetherNetHTTPSignaling
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the signalling instance.setHttpsKeystore(File httpsKeystore) Sets the unprotected keystore holding the TLS certificate and key.setHttpsKeystore(File httpsKeystore, String httpsPassword) Sets the keystore holding the TLS certificate and key.setIdentityKeystore(File identityKeystore) Sets the unprotected keystore holding the identity key.setIdentityKeystore(File identityKeystore, String identityPassword) Sets the keystore holding the identity key used to sign SDP answers.Sets a fixed MOTD to advertise for every status request.setMotdProvider(NetherNetHTTPSignaling.MotdProvider motdProvider) Sets the provider called for each status request.setPlayerFilter(NetherNetHTTPSignaling.PlayerFilter playerFilter) Sets the filter consulted for each join once its identity has been validated.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setIdentityKeystore
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 keyidentityPassword- Password foridentityKeystore, or "" if unprotected- Returns:
- This builder
-
setHttpsKeystore
Sets the unprotected keystore holding the TLS certificate and key.- Parameters:
httpsKeystore- PKCS12 keystore holding the TLS certificate and key- Returns:
- This builder
-
setHttpsKeystore
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 keyhttpsPassword- Password forhttpsKeystore, or "" if unprotected- Returns:
- This builder
-
setPlayerFilter
public NetherNetHTTPSignaling.Builder setPlayerFilter(NetherNetHTTPSignaling.PlayerFilter playerFilter) 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
public NetherNetHTTPSignaling.Builder setMotdProvider(NetherNetHTTPSignaling.MotdProvider motdProvider) Sets the provider called for each status request. Defaults toNetherNetServerSignaling.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
Builds the signalling instance.- Returns:
- A new signalling instance
- Throws:
IllegalStateException- If no identity keystore was set
-