Skip to content

Commit

Permalink
fix: use symbol instead of unknown type for connection id
Browse files Browse the repository at this point in the history
  • Loading branch information
szmarczak committed Apr 10, 2022
1 parent 24cf4df commit a6d51fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type HandlerOpts = {
};

export type PrepareRequestFunctionOpts = {
connectionId: unknown;
connectionId: symbol;
request: http.IncomingMessage;
username: string;
password: string;
Expand Down Expand Up @@ -350,7 +350,7 @@ export class Server extends EventEmitter {
// Authenticate the request using a user function (if provided)
if (this.prepareRequestFunction) {
const funcOpts: PrepareRequestFunctionOpts = {
connectionId: (request.socket as Socket).proxyChainId,
connectionId: (request.socket as Socket).proxyChainId!,
request,
username: '',
password: '',
Expand Down
2 changes: 1 addition & 1 deletion src/socket.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type net from 'net';
import type tls from 'tls';

type AdditionalProps = { proxyChainId?: unknown };
type AdditionalProps = { proxyChainId?: symbol };

export type Socket = net.Socket & AdditionalProps;
export type TLSSocket = tls.TLSSocket & AdditionalProps;

0 comments on commit a6d51fb

Please sign in to comment.