Re: [go-nuts] Listen and serve HTTP on multiple IP addresses

835 views
Skip to first unread message

Rémy Oudompheng

unread,
Aug 28, 2012, 4:52:46 PM8/28/12
to Mauro Trajber, golan...@googlegroups.com
On 2012/8/28 Mauro Trajber <tra...@gmail.com> wrote:
> I have a server with many IP addresses and network interfaces and I want to
> listen and serve HTTP on only two of these addresses. Using the Serve
> function of net/http package I can specify only one net.Listener.

For example, use Serve twice.

Rémy.

Andy Balholm

unread,
Aug 28, 2012, 5:42:52 PM8/28/12
to golan...@googlegroups.com, Mauro Trajber
go http.ListenAndServe("10.0.0.1:80", nil)
http.ListenAndServe("10.0.0.2:80", nil)
Reply all
Reply to author
Forward
0 new messages