Kouhei Sutou
null+****@clear*****
Thu Mar 20 22:18:01 JST 2014
Kouhei Sutou 2014-03-20 22:18:01 +0900 (Thu, 20 Mar 2014) New Revision: 9bfeb36081dd864de7eb9755bffc0f458171f739 https://github.com/droonga/express-droonga/commit/9bfeb36081dd864de7eb9755bffc0f458171f739 Message: Use "127.0.0.1" instead of "localhost" To work with "localhost" is "::1" environment. Modified files: lib/droonga-protocol/connection.js test/droonga-protocol/connection.test.js test/test-utils.js Modified: lib/droonga-protocol/connection.js (+4 -4) =================================================================== --- lib/droonga-protocol/connection.js 2014-03-20 18:43:47 +0900 (de9a008) +++ lib/droonga-protocol/connection.js 2014-03-20 22:18:01 +0900 (87bdf52) @@ -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 }); */ @@ -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 = Modified: test/droonga-protocol/connection.test.js (+2 -2) =================================================================== --- test/droonga-protocol/connection.test.js 2014-03-20 18:43:47 +0900 (58c7810) +++ test/droonga-protocol/connection.test.js 2014-03-20 22:18:01 +0900 (cd83c57) @@ -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, @@ -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 Modified: test/test-utils.js (+6 -6) =================================================================== --- test/test-utils.js 2014-03-20 18:43:47 +0900 (33a8aad) +++ test/test-utils.js 2014-03-20 22:18:01 +0900 (32ac972) @@ -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; @@ -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, @@ -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; @@ -177,7 +177,7 @@ function createStubbedBackendConnection() { }, emitMessageCalledArguments: [], getRouteToSelf: function() { - return 'localhost:' + testReceivePort + '/' + testTag; + return '127.0.0.1:' + testReceivePort + '/' + testTag; }, emit: function() {}, @@ -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, @@ -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, -------------- next part -------------- HTML����������������������������... Download