服务器端口

如果我们不指定端口,那么http服务使用的就是默认的端口80。

下面的代码:

HttpServer.Prefixes.Add("http://*/")
HttpServer
.Start()

等同于:

HttpServer.Prefixes.Add("http://*:80/")
HttpServer
.Start()

有时,我们需要给自己的http服务更换端口。
例如你公司已经有了一台web服务器,现在你需要利用这台服务器运行Foxtable的http服务,那么就不能使用80端口了,因为这样会和原来的web服务发生冲突。

换个端口开启http服务很简单,例如:

HttpServer.Prefixes.Add("http://*:32177/")
HttpServer
.Start()

现在你要访问这个http服务,地址必须加上端口号才行:

为了方便,就下来的例子还是使用默认的端口80。

 


本页地址:http://www.foxtable.com/mobilehelp/topics/0003.htm