From fc1dfa1ceb8897bcaa5231b560b9319591d4ab0a Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Fri, 16 Feb 2018 21:04:56 +0000 Subject: [PATCH] Add net.Dialer DualStack config option. --- client/connection.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/connection.go b/client/connection.go index f84621a..12d0e59 100644 --- a/client/connection.go +++ b/client/connection.go @@ -82,6 +82,11 @@ type Config struct { // Local address to bind to when connecting to the server. LocalAddr string + // To attempt RFC6555 parallel IPv4 and IPv6 connections if both + // address families are returned for a hostname, set this to true. + // Passed through to https://golang.org/pkg/net/#Dialer + DualStack bool + // Replaceable function to customise the 433 handler's new nick. // By default an underscore "_" is appended to the current nick. NewNick func(string) string @@ -160,6 +165,7 @@ func Client(cfg *Config) *Conn { dialer := new(net.Dialer) dialer.Timeout = cfg.Timeout + dialer.DualStack = cfg.DualStack if cfg.LocalAddr != "" { if !hasPort(cfg.LocalAddr) { cfg.LocalAddr += ":0"