Can I setup multi port from one web app with Go?

user4611478

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!

JimB

No, you cannot.

You can however start multiple listeners on different ports

go http.ListenAndServe(PORT, handlerA)
http.ListenAndServe(PORT, handlerB)

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

iOS/Objective-C - How do I query a web server database from an iPhone app?

来自分类Dev

Deploying Go 1.6 web app to AWS Elastic Beanstalk?

来自分类Dev

How can I display the data from my Firebase Database in my web site?

来自分类Dev

C: can I forward port for external application with libssh?

来自分类Dev

How can I find out what version is passed to setup in setup.py?

来自分类Dev

Calling a google app script from a web page

来自分类Dev

How can I create a web application using Angular frontend and Node backend and Git hub API starting from OAuth?

来自分类Dev

How can I stop my installer from triggering Windows 10's "This app has been blocked for your protection" error?

来自分类Dev

How can I modify this countdown to not go below zero?

来自分类Dev

Choosing a CPU for a multi-seat setup

来自分类Dev

How do I rewrite / redirect from http to https in Go?

来自分类Dev

Symfony2 - Console commands, how can I setup environment configuration?

来自分类Dev

Is there a difference between an I/O port and a physical port?

来自分类Dev

Android Studio: Error getting string from resource in multi-language app

来自分类Dev

I can only make a cookie have one value in javascript

来自分类Dev

Can I see all the string values (resources) in one place?

来自分类Dev

How can I populate more than one zendform?

来自分类Dev

How can I create a SUM of one column within a query in SQL?

来自分类Dev

部署Go App

来自分类Dev

部署Go App

来自分类Dev

How can I use google web fonts with phantomjs

来自分类Dev

How can I find my browser web log file?

来自分类Dev

How can I extract text from images?

来自分类Dev

Can I use Goroutines in Google App Engine (Standard Environment)?

来自分类Dev

Unfortunately the app has stopped. What can I do to fix this?

来自分类Dev

How can I debug an iOS app executed in mobile not launched by Xcode?

来自分类Dev

How can one prevent a git branch from being merged into another?

来自分类Dev

iris(Go web framework)iris.PongoEngine error from iris Official book

来自分类Dev

什么是端口转发中的“Local Port from”、“Local Port to”、“Remote Port from”和“Remote port to”?

Related 相关文章

  1. 1

    iOS/Objective-C - How do I query a web server database from an iPhone app?

  2. 2

    Deploying Go 1.6 web app to AWS Elastic Beanstalk?

  3. 3

    How can I display the data from my Firebase Database in my web site?

  4. 4

    C: can I forward port for external application with libssh?

  5. 5

    How can I find out what version is passed to setup in setup.py?

  6. 6

    Calling a google app script from a web page

  7. 7

    How can I create a web application using Angular frontend and Node backend and Git hub API starting from OAuth?

  8. 8

    How can I stop my installer from triggering Windows 10's "This app has been blocked for your protection" error?

  9. 9

    How can I modify this countdown to not go below zero?

  10. 10

    Choosing a CPU for a multi-seat setup

  11. 11

    How do I rewrite / redirect from http to https in Go?

  12. 12

    Symfony2 - Console commands, how can I setup environment configuration?

  13. 13

    Is there a difference between an I/O port and a physical port?

  14. 14

    Android Studio: Error getting string from resource in multi-language app

  15. 15

    I can only make a cookie have one value in javascript

  16. 16

    Can I see all the string values (resources) in one place?

  17. 17

    How can I populate more than one zendform?

  18. 18

    How can I create a SUM of one column within a query in SQL?

  19. 19

    部署Go App

  20. 20

    部署Go App

  21. 21

    How can I use google web fonts with phantomjs

  22. 22

    How can I find my browser web log file?

  23. 23

    How can I extract text from images?

  24. 24

    Can I use Goroutines in Google App Engine (Standard Environment)?

  25. 25

    Unfortunately the app has stopped. What can I do to fix this?

  26. 26

    How can I debug an iOS app executed in mobile not launched by Xcode?

  27. 27

    How can one prevent a git branch from being merged into another?

  28. 28

    iris(Go web framework)iris.PongoEngine error from iris Official book

  29. 29

    什么是端口转发中的“Local Port from”、“Local Port to”、“Remote Port from”和“Remote port to”?

热门标签

归档