Fleck icon indicating copy to clipboard operation
Fleck copied to clipboard

when used hostname instead of IP, WampHost() throws error!

Open jareesh opened this issue 5 years ago • 1 comments

Ref: https://github.com/Code-Sharp/WampSharp/issues/310

When used hostname instead of IP, WampHost throws error! I am planning to host the router as a .net core based IIS service. When i start the service, It works if i give IP as below _host = new DefaultWampAuthenticationHost("ws://127.0.0.1:26429/", new AuthenticatorFactory()); It fails and throws below error if i give host name as below _host = new DefaultWampAuthenticationHost("ws://ie3pltjvhjzw2:26429/", new AuthenticatorFactory());

//Class: NotificationTransport::Service starter public bool StartService(IEnumerable realmNames, string hubURL) ..... _host = new DefaultWampAuthenticationHost(hubURL, new AuthenticatorFactory());

//class Startup - .net core startup .....WORKING.... _notificationTransport.StartService(new List { Constants.NotificationHubRealm }, "ws://127.0.0.1:26429/"); ..... .....NOT WORKING.... _notificationTransport.StartService(new List { Constants.NotificationHubRealm }, "ws://ie3pltjvhjzw2:26429/"); .....

ErrorLog

ERROR StartService - Excecption occured : System.FormatException: Failed to parse the IP address part of the location. Please make sure you specify a valid IP address. Use 0.0.0.0 or [::] to listen on all interfaces. ---> System.FormatException: An invalid IP address was specified. ---> System.Net.Sockets.SocketException (10022): An invalid argument was supplied. --- End of inner exception stack trace --- at System.Net.IPAddressParser.Parse(ReadOnlySpan1 ipSpan, Boolean tryParse) at System.Net.IPAddress.Parse(String ipString) at Fleck.WebSocketServer.ParseIPAddress(Uri uri) --- End of inner exception stack trace --- at Fleck.WebSocketServer.ParseIPAddress(Uri uri) at Fleck.WebSocketServer..ctor(String location, Boolean supportDualStack) at WampSharp.Fleck.FleckWebSocketTransport..ctor(String location, ICookieAuthenticatorFactory cookieAuthenticatorFactory, X509Certificate2 certificate, Func1 getEnabledSslProtocols, Boolean supportDualStack) at WampSharp.Fleck.FleckWebSocketTransport..ctor(String location, X509Certificate2 certificate, Func1 getEnabledSslProtocols, Boolean supportDualStack) at WampSharp.V2.DefaultWampHost..ctor(String location, IWampRealmContainer realmContainer, IWampUriValidator uriValidator, IEnumerable1 bindings, X509Certificate2 certificate, Func1 getEnabledSslProtocols) at WampSharp.V2.DefaultWampHost..ctor(String location, IWampRealmContainer realmContainer, IWampUriValidator uriValidator, IEnumerable1 bindings, X509Certificate2 certificate) at WampSharp.V2.DefaultWampHost..ctor(String location, IEnumerable1 bindings, X509Certificate2 certificate) at WampSharp.V2.DefaultWampHost..ctor(String location, X509Certificate2 certificate) at WampSharp.V2.DefaultWampHost..ctor(String location) at Honeywell.PW.Services.Notification.Transport.NotificationTransport.StartService(IEnumerable1 realmNames, String hubURL) in C:\isrtGit\services.notificationhub\src\Honeywell.PW.Services.Notification.Transport\NotificationTransport.cs:line 32

jareesh avatar Jan 23 '20 11:01 jareesh

Use 0.0.0.0 as the error indicates...

Use 0.0.0.0 or [::] to listen on all interfaces.

, then you don't need to specify a specific hostname.

AdrianBathurst avatar Jan 23 '20 11:01 AdrianBathurst