Skip to content

Commit

Permalink
Assume 443 on empty port. Fixes #9
Browse files Browse the repository at this point in the history
  • Loading branch information
dom96 authored Sep 21, 2023
1 parent eb36f79 commit 9a53cf3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export function connect(
options?: SocketOptions,
): Socket {
if (typeof address === 'string') {
const url = new URL(address);
const url = new URL("https://" + address);
// eslint-disable-next-line no-param-reassign -- there is no harm reassigning to this param
address = {
hostname: url.hostname,
port: parseInt(url.port),
port: parseInt(url.port == "" ? "443" : url.port),
};
}
return new Socket(address, options);
Expand Down

0 comments on commit 9a53cf3

Please sign in to comment.