@@ -94,6 +94,13 @@ aropt = util.aropt
94
94
mkAtom = util .mkAtom
95
95
mkErr = util .mkErr
96
96
97
+ # These are the default hostname and port used by RethinkDB
98
+ DEFAULT_HOST = ' localhost'
99
+ DEFAULT_PORT = 28015
100
+
101
+ module .exports .DEFAULT_HOST = DEFAULT_HOST
102
+ module .exports .DEFAULT_PORT = DEFAULT_PORT
103
+
97
104
# These are strings returned by the server after a handshake
98
105
# request. Since they must match exactly they're defined in
99
106
# "constants" here at the top
@@ -121,10 +128,7 @@ HANDSHAKE_AUTHFAIL = "ERROR: Incorrect authorization key.\n"
121
128
# - `"timeout"` will be emitted by the `TcpConnection` subclass if the
122
129
# underlying socket times out for any reason.
123
130
class Connection extends events.EventEmitter
124
-
125
- # These are the default hostname and port used by RethinkDB
126
- DEFAULT_HOST : ' localhost'
127
- DEFAULT_PORT : 28015
131
+
128
132
# By default, RethinkDB doesn't use an authorization key.
129
133
DEFAULT_AUTH_KEY : ' '
130
134
# Each connection has a timeout (in seconds) for the initial handshake with the
@@ -145,8 +149,8 @@ class Connection extends events.EventEmitter
145
149
host = {host : host}
146
150
147
151
# Here we set all of the connection parameters to their defaults.
148
- @host = host .host || @ DEFAULT_HOST
149
- @port = host .port || @ DEFAULT_PORT
152
+ @host = host .host || DEFAULT_HOST
153
+ @port = host .port || DEFAULT_PORT
150
154
151
155
# One notable exception to defaulting is the db name. If the
152
156
# user doesn't specify it, we leave it undefined. On the
0 commit comments