dqfaom241360
2018-06-06 10:18
浏览 111
已采纳

如何使用http而不是https在Heroku上提供Golang应用程序?

I need to host a golang app on heroku and reach it using http instead of https. Any idea how I can do it?

图片转代码服务由CSDN问答提供 功能建议

我需要在heroku上托管一个golang应用程序,并使用http而不是https来访问它。 任何想法我都可以 是吗?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

  • dongya9904 2018-06-06 10:46
    最佳回答

    Delete the 's' from the URL when you try to access your app, that's all it takes.

    Just make sure you start the Go web server in normal (HTTP) mode. The HTTPS layer is added by the Heroku platform, but your app is still available via both HTTP and HTTPS protocol.

    So for example if you access your app using the URL:

    https://myapp.herokuapp.com
    

    You may also use

    http://myapp.herokuapp.com
    
    评论
    解决 无用
    打赏 举报