3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

dial tcp [::1]:80: getsockopt: connection refused というエラー

Posted at

##原因
dockerを使って複数のコンテナを立ち上げた時にコンテナ間のやりとりをhttpdのpostを使ったらはまった。

##解決策

 resp, err := http.PostForm(
      "http://localhost/test.php",
      url.Values{
        "test": bar,
      },
  )

ではなく

resp, err := http.PostForm(
      "http://コンテナのhostname/test.php",
      url.Values{
        "test": bar,
      },
  )

とやるとコンテナ間でやりとりができるようになった。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?