Skip to content

Commit cce7aad

Browse files
fix: allow multiple connections via .startLocalProxy socket (#366)
The .startLocalProxy method of starting a local Unix socket to connect over used .once which was an oversight. This only allows a single connection via the socket. For a connection pool to leverage several connections at once we should use .on. Tested using Prisma's connection_limit query argument. Using .once only works with connection_limit=1 while using .on allows for connection_limit=2 etc.
1 parent 9f3381b commit cce7aad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/connector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,9 @@ export class Connector {
303303
console.error(err);
304304
});
305305

306-
// Once a connection is stablished, pipe data from the
306+
// When a connection is established, pipe data from the
307307
// local proxy server to the secure TCP Socket and vice-versa.
308-
server.once('connection', c => {
308+
server.on('connection', c => {
309309
const s = stream();
310310
this.sockets.add(s);
311311
this.sockets.add(c);

0 commit comments

Comments
 (0)