@@ -17,47 +17,59 @@ public MosquittoContainer(MosquittoConfiguration configuration)
1717 }
1818
1919 /// <summary>
20- /// Gets the MQTT endpoint .
20+ /// Gets the MQTT port .
2121 /// </summary>
22- /// <returns>An MQTT address in the format: <c>mqtt://hostname:port</c>.</returns>
23- public string GetEndpoint ( )
22+ public ushort MqttPort => GetMappedPublicPort ( MosquittoBuilder . MqttPort ) ;
23+
24+ /// <summary>
25+ /// Gets the secure MQTT port.
26+ /// </summary>
27+ public ushort MqttTlsPort => GetMappedPublicPort ( MosquittoBuilder . MqttTlsPort ) ;
28+
29+ /// <summary>
30+ /// Gets the MQTT connection string.
31+ /// </summary>
32+ /// <returns>An MQTT connection string in the format: <c>mqtt://hostname:port</c>.</returns>
33+ public string GetConnectionString ( )
2434 {
25- return new UriBuilder ( "mqtt" , Hostname , GetMappedPublicPort ( MosquittoBuilder . MqttPort ) ) . ToString ( ) ;
35+ return new UriBuilder ( "mqtt" , Hostname , MqttPort ) . ToString ( ) ;
2636 }
2737
2838 /// <summary>
29- /// Gets the secure MQTT endpoint .
39+ /// Gets the secure MQTT connection string .
3040 /// </summary>
31- /// <returns>A secure MQTT address in the format: <c>mqtts://hostname:port</c>.</returns>
32- public string GetSecureEndpoint ( )
41+ /// <returns>A secure MQTT connection string in the format: <c>mqtts://hostname:port</c>.</returns>
42+ /// <exception cref="InvalidOperationException">TLS/SSL support is not enabled in the container configuration.</exception>
43+ public string GetSecureConnectionString ( )
3344 {
3445 ThrowIfTlsNotEnabled ( ) ;
35- return new UriBuilder ( "mqtts" , Hostname , GetMappedPublicPort ( MosquittoBuilder . MqttTlsPort ) ) . ToString ( ) ;
46+ return new UriBuilder ( "mqtts" , Hostname , MqttTlsPort ) . ToString ( ) ;
3647 }
3748
3849 /// <summary>
39- /// Gets the WebSocket endpoint .
50+ /// Gets the MQTT over WebSocket connection string .
4051 /// </summary>
41- /// <returns>A WS address in the format: <c>ws://hostname:port</c>.</returns>
42- public string GetWsEndpoint ( )
52+ /// <returns>A WebSocket connection string in the format: <c>ws://hostname:port</c>.</returns>
53+ public string GetWsConnectionString ( )
4354 {
4455 return new UriBuilder ( "ws" , Hostname , GetMappedPublicPort ( MosquittoBuilder . MqttWsPort ) ) . ToString ( ) ;
4556 }
4657
4758 /// <summary>
48- /// Gets the secure WebSocket endpoint .
59+ /// Gets the secure MQTT over WebSocket connection string .
4960 /// </summary>
50- /// <returns>A secure WS address in the format: <c>wss://hostname:port</c>.</returns>
51- public string GetWssEndpoint ( )
61+ /// <returns>A secure WebSocket connection string in the format: <c>wss://hostname:port</c>.</returns>
62+ /// <exception cref="InvalidOperationException">TLS/SSL support is not enabled in the container configuration.</exception>
63+ public string GetWssConnectionString ( )
5264 {
5365 ThrowIfTlsNotEnabled ( ) ;
5466 return new UriBuilder ( "wss" , Hostname , GetMappedPublicPort ( MosquittoBuilder . MqttWssPort ) ) . ToString ( ) ;
5567 }
5668
5769 /// <summary>
58- /// Throws <see cref="InvalidOperationException" /> when TLS/SSL is not enabled in the configuration.
70+ /// Throws <see cref="InvalidOperationException" /> when TLS/SSL support is not enabled in the container configuration.
5971 /// </summary>
60- /// <exception cref="InvalidOperationException">TLS/SSL is not enabled in the configuration.</exception>
72+ /// <exception cref="InvalidOperationException">TLS/SSL support is not enabled in the container configuration.</exception>
6173 private void ThrowIfTlsNotEnabled ( )
6274 {
6375 if ( ! _configuration . TlsEnabled )
0 commit comments