[Modify] Add it

This commit is contained in:
sta 2017-07-06 15:00:13 +09:00
parent a59192a264
commit 18e0dd4c6d

View File

@ -871,6 +871,19 @@ namespace WebSocketSharp.Server
.Replace ('\\', '/');
}
private static HttpListener createListener (
string hostname, int port, bool secure
)
{
var lsnr = new HttpListener ();
var schm = secure ? "https" : "http";
var pref = String.Format ("{0}://{1}:{2}/", schm, hostname, port);
lsnr.Prefixes.Add (pref);
return lsnr;
}
private static string getHost (Uri uri)
{
return uri.HostNameType == UriHostNameType.IPv6 ? uri.Host : uri.DnsSafeHost;