diff --git a/Assets/Mirror/Transports/Encryption/EncryptionTransport.cs b/Assets/Mirror/Transports/Encryption/EncryptionTransport.cs index b9d1b9d12..d749f08a6 100644 --- a/Assets/Mirror/Transports/Encryption/EncryptionTransport.cs +++ b/Assets/Mirror/Transports/Encryption/EncryptionTransport.cs @@ -7,12 +7,35 @@ namespace Mirror.Transports.Encryption { [HelpURL("https://mirror-networking.gitbook.io/docs/manual/transports/encryption-transport")] - public class EncryptionTransport : Transport + public class EncryptionTransport : Transport, PortTransport { public override bool IsEncrypted => true; public override string EncryptionCipher => "AES256-GCM"; public Transport inner; + public ushort Port + { + get + { + if (inner is PortTransport portTransport) + { + return portTransport.Port; + } + + Debug.LogError($"EncryptionTransport can't get Port because {inner} is not a PortTransport"); + return 0; + } + set + { + if (inner is PortTransport portTransport) + { + portTransport.Port = value; + return; + } + Debug.LogError($"EncryptionTransport can't set Port because {inner} is not a PortTransport"); + } + } + public enum ValidationMode { Off,