[Modify] Replace it
This commit is contained in:
parent
2915c18811
commit
6d24085b7a
@ -83,6 +83,10 @@ namespace WebSocketSharp.Net
|
|||||||
{
|
{
|
||||||
var pref = new HttpListenerPrefix (uriPrefix);
|
var pref = new HttpListenerPrefix (uriPrefix);
|
||||||
|
|
||||||
|
var addr = convertToIPAddress (pref.Host);
|
||||||
|
|
||||||
|
var port = pref.Port;
|
||||||
|
|
||||||
var path = pref.Path;
|
var path = pref.Path;
|
||||||
if (path.IndexOf ('%') != -1)
|
if (path.IndexOf ('%') != -1)
|
||||||
throw new HttpListenerException (87, "Includes an invalid path.");
|
throw new HttpListenerException (87, "Includes an invalid path.");
|
||||||
@ -91,7 +95,7 @@ namespace WebSocketSharp.Net
|
|||||||
throw new HttpListenerException (87, "Includes an invalid path.");
|
throw new HttpListenerException (87, "Includes an invalid path.");
|
||||||
|
|
||||||
// Listens on all the interfaces if host name cannot be parsed by IPAddress.
|
// Listens on all the interfaces if host name cannot be parsed by IPAddress.
|
||||||
getEndPointListener (pref, listener).AddPrefix (pref, listener);
|
getEndPointListener (addr, port, pref.IsSecure, listener).AddPrefix (pref, listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IPAddress convertToIPAddress (string hostname)
|
private static IPAddress convertToIPAddress (string hostname)
|
||||||
|
Loading…
Reference in New Issue
Block a user