Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed default options host to loopback instead of localhost #982

Merged
merged 1 commit into from Dec 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/clustering_test.go
Expand Up @@ -106,7 +106,7 @@ func getTestDefaultOptsForClustering(id string, bootstrap bool) *Options {
opts.Clustering.LogCacheSize = DefaultLogCacheSize
opts.Clustering.LogSnapshots = 1
opts.Clustering.RaftLogging = true
opts.NATSServerURL = "nats://localhost:4222"
opts.NATSServerURL = "nats://127.0.0.1:4222"
return opts
}

Expand Down Expand Up @@ -557,7 +557,7 @@ func TestClusteringBootstrapMisconfiguration(t *testing.T) {
n2Opts := natsdTest.DefaultTestOptions
n2Opts.Host = "127.0.0.1"
n2Opts.Port = 4223
n2Opts.Cluster.Host = "localhost"
n2Opts.Cluster.Host = "127.0.0.1"
n2Opts.Cluster.Port = 6223
s2sOpts := getTestDefaultOptsForClustering("b", true)
s2sOpts.NATSServerURL = ""
Expand Down
4 changes: 2 additions & 2 deletions server/monitor_test.go
Expand Up @@ -46,12 +46,12 @@ const (
)

var defaultMonitorOptions = natsd.Options{
Host: "localhost",
Host: "127.0.0.1",
Port: 4222,
HTTPHost: monitorHost,
HTTPPort: monitorPort,
Cluster: natsd.ClusterOpts{
Host: "localhost",
Host: "127.0.0.1",
Port: 6222,
},
NoLog: true,
Expand Down
2 changes: 1 addition & 1 deletion server/server.go
Expand Up @@ -1337,7 +1337,7 @@ func GetDefaultOptions() (o *Options) {

// DefaultNatsServerOptions are default options for the NATS server
var DefaultNatsServerOptions = server.Options{
Host: "localhost",
Host: "127.0.0.1",
Port: 4222,
NoLog: true,
NoSigs: true,
Expand Down
4 changes: 2 additions & 2 deletions server/server_clients_test.go
Expand Up @@ -345,7 +345,7 @@ func TestClientsWithDupCID(t *testing.T) {

connect := func(cid string, shouldFail bool) (stan.Conn, time.Duration, error) {
start := time.Now()
c, err := stan.Connect(clusterName, cid, stan.ConnectWait(3*s.dupCIDTimeout))
c, err := stan.Connect(clusterName, cid, stan.NatsURL(nats.DefaultURL), stan.ConnectWait(3*s.dupCIDTimeout))
duration := time.Since(start)
if shouldFail {
if c != nil {
Expand Down Expand Up @@ -401,7 +401,7 @@ func TestClientsWithDupCID(t *testing.T) {
t.Fatalf("%v", err)
}
defer newConn.Close()
if duration >= dupTimeoutMin {
if duration >= dupTimeoutMax {
t.Fatalf("Connect expected to be fast, took %v", duration)
}

Expand Down
2 changes: 1 addition & 1 deletion server/server_run_test.go
Expand Up @@ -422,7 +422,7 @@ func TestDontEmbedNATSRunning(t *testing.T) {
sOpts.NATSServerURL = "nats://localhost:5223"

nOpts := DefaultNatsServerOptions
nOpts.Host = "localhost"
nOpts.Host = "127.0.0.1"
nOpts.Port = 5223
natsd := natsdTest.RunServer(&nOpts)
defer natsd.Shutdown()
Expand Down
2 changes: 1 addition & 1 deletion server/signal_test.go
Expand Up @@ -59,7 +59,7 @@ func TestSignalToReOpenLogFile(t *testing.T) {
sopts := GetDefaultOptions()
sopts.HandleSignals = true
nopts := &natsd.Options{
Host: "localhost",
Host: "127.0.0.1",
Port: -1,
NoSigs: true,
LogFile: logFile,
Expand Down