Skip to content

Commit

Permalink
Use "127.0.0.1" instead of "localhost"
Browse files Browse the repository at this point in the history
To work with "localhost" is "::1" environment.
  • Loading branch information
kou committed Mar 20, 2014
1 parent df144bc commit 9bfeb36
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions lib/droonga-protocol/connection.js
@@ -1,9 +1,9 @@
/**
* var connection = new Connection({ tag: 'droonga',
* defaultDataset: 'example',
* hostName: 'localhost',
* hostName: '127.0.0.1',
* port: 24224,
* receiveHostName: 'localhost',
* receiveHostName: '127.0.0.1',
* receivePort: 10030,
* receiverMaxAge: 100 });
*/
Expand All @@ -19,13 +19,13 @@ var DEFAULT_FLUENT_TAG =
'droonga';
var DEFAULT_FLUENT_HOST_NAME =
Connection.DEFAULT_FLUENT_HOST_NAME =
'localhost';
'127.0.0.1';
var DEFAULT_FLUENT_PORT =
Connection.DEFAULT_FLUENT_PORT =
24224;
var DEFAULT_RECEIVE_HOST_NAME =
Connection.DEFAULT_RECEIVE_HOST_NAME =
'localhost';
'127.0.0.1';

var ERROR_GATEWAY_TIMEOUT =
Connection.ERROR_GATEWAY_TIMEOUT =
Expand Down
4 changes: 2 additions & 2 deletions test/droonga-protocol/connection.test.js
Expand Up @@ -65,7 +65,7 @@ suite('Connection', function() {
connection = new Connection({
tag: 'test',
defaultDataset: 'test-dataset',
hostName: 'localhost',
hostName: '127.0.0.1',
port: utils.testSendPort,
receivePort: utils.testReceivePort,
maxRetyrCount: 3,
Expand Down Expand Up @@ -461,7 +461,7 @@ suite('Connection', function() {
backend = newBackend;
connection = new Connection({
tag: utils.testTag,
hostName: 'localhost',
hostName: '127.0.0.1',
port: utils.testSendPort,
maxRetyrCount: 3,
retryDelay: 1
Expand Down
12 changes: 6 additions & 6 deletions test/test-utils.js
Expand Up @@ -26,7 +26,7 @@ function connectTo(port) {
clientSocket.destroy();
deferred.fail(error);
});
clientSocket.connect(port, 'localhost', function(){
clientSocket.connect(port, '127.0.0.1', function(){
deferred.call(clientSocket);
});
return deferred;
Expand Down Expand Up @@ -79,7 +79,7 @@ function sendRequest(method, path, postData, headers) {
var deferred = new Deferred();

var options = {
host: 'localhost',
host: '127.0.0.1',
port: testServerPort,
path: path,
method: method,
Expand Down Expand Up @@ -132,7 +132,7 @@ Deferred.register('post', function() { return post.apply(this, arguments); });

function createClient() {
var deferred = new Deferred();
var host = 'http://localhost:' + testServerPort;
var host = 'http://127.0.0.1:' + testServerPort;
var options = { 'force new connection': true };
var socket = client.connect(host, options);
var newClientSocket;
Expand Down Expand Up @@ -177,7 +177,7 @@ function createStubbedBackendConnection() {
},
emitMessageCalledArguments: [],
getRouteToSelf: function() {
return 'localhost:' + testReceivePort + '/' + testTag;
return '127.0.0.1:' + testReceivePort + '/' + testTag;
},

emit: function() {},
Expand All @@ -203,7 +203,7 @@ function setupApplication() {
var connection = new Connection({
tag: testTag,
defaultDataset: 'test-dataset',
hostName: 'localhost',
hostName: '127.0.0.1',
port: testSendPort,
receivePort: testReceivePort,
maxRetyrCount: 3,
Expand Down Expand Up @@ -320,7 +320,7 @@ function createEnvelope(type, body, options) {
var envelope = {
id: now.getTime(),
date: now.toISOString(),
from: 'localhost:' + testReceivePort + '/' + testTag,
from: '127.0.0.1:' + testReceivePort + '/' + testTag,
statusCode: 200,
dataset: options.dataset || 'test-dataset',
type: type,
Expand Down

0 comments on commit 9bfeb36

Please sign in to comment.