As I know, I can run simple web server with Golang just use http
package, like
http.ListenAndServe(PORT, nil)
where PORT is TCP address to listen.
Can I use PORT as PORTS, for example http.ListenAndServe(":80, :8080", nil)
from one application?
Possible my question is stupid, but "Who don't ask, He will not get answer!"
Thanks for advance!
No, you cannot.
You can however start multiple listeners on different ports
go http.ListenAndServe(PORT, handlerA)
http.ListenAndServe(PORT, handlerB)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句