Skip to content

Commit

Permalink
Support secure localhost protocols
Browse files Browse the repository at this point in the history
In case something like Herd or a hosts file is used, this then supports SSL/TLS URLs when providing an HTTPS host.
  • Loading branch information
caendesilva committed Nov 11, 2023
1 parent bfa7e7b commit 4bf006f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/realtime-compiler/src/ConsoleOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function printStartMessage(string $host, int $port): void
$title = 'HydePHP Realtime Compiler';
$version = ' v'.Hyde::version();

$url = sprintf('http://%s:%d', $host, $port);
$url = sprintf('%s://%s:%d', $port === 443 ? 'https' : 'http', $host, $port);

$width = max(strlen("$title $version"), strlen("Listening on $url") + 1) + 1;
$spacing = str_repeat(' ', $width);
Expand Down

0 comments on commit 4bf006f

Please sign in to comment.