-
Notifications
You must be signed in to change notification settings - Fork 306
feat: add WSS support for HTTPS environments #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aidenybai
wants to merge
26
commits into
main
Choose a base branch
from
feat/wss-secure-relay
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
284241c
feat: add WSS support for HTTPS environments
aidenybai a96448b
fix: use current hostname instead of hardcoded localhost
aidenybai 0589400
fix: resolve SSL, mkcert, and code duplication issues
cursoragent 8510d3c
fix
aidenybai 5f1aa7b
fix: add certHostnames option to support custom local domains
cursoragent b3ebab8
fix: use native https module instead of undici for health checks
aidenybai e384018
Fix WSS relay bugs: cert hostnames, race condition, health check prot…
cursoragent f8197ae
fix: add @types/node to utils package and use proper import
aidenybai f6029b0
fix: resolve security and logic bugs in WSS relay implementation
cursoragent fa6ee95
Fix certificate hostname tracking and onSecureUpgradeRequested type
cursoragent 54b867c
Fix unnecessary dynamic import for unlink in mkcert.ts
cursoragent b772d01
fix: handle corrupted cert-hosts.json with try-catch around JSON.parse
cursoragent df38df2
fix: prevent hostname flag injection in mkcert execution
cursoragent 94006d7
fix: properly await httpServer.close() and webSocketServer.close() in…
cursoragent 9b8b371
fix: add retry delay when response.ok is false in ensureServerReady
cursoragent ab76689
fix: retry on network errors during server upgrade
cursoragent 65cff04
fix: implement retry delay for connection upgrades and enhance error …
aidenybai d4e9540
Fix relay server auto-upgrade bugs and reconnection issues
cursoragent 8b48e7c
Fix WebSocket connection and reconnection reliability issues
cursoragent abc9913
fix: resolve protocol fallback, network error handling, and reconnect…
cursoragent 3213357
Fix startup message showing wrong protocol when connecting to existin…
cursoragent 4b5ea74
Refactor relay package for clarity and consistency
aidenybai f2f42ab
fix
aidenybai e2e98d8
Fix protocol upgrade and reconnection bugs
cursoragent e9a091b
fix(relay): prioritize user secure preference and cleanup reconnect t…
cursoragent c2472f4
Fix protocol mismatch when connecting to existing relay
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| .next | ||
|
|
||
| certificates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,4 @@ | ||
| #!/usr/bin/env node | ||
| import { spawn } from "node:child_process"; | ||
| import { realpathSync } from "node:fs"; | ||
| import { dirname, join } from "node:path"; | ||
| import { spawnDetachedServer } from "@react-grab/utils/server"; | ||
|
|
||
| const realScriptPath = realpathSync(process.argv[1]); | ||
| const scriptDir = dirname(realScriptPath); | ||
| const serverPath = join(scriptDir, "server.cjs"); | ||
|
|
||
| const child = spawn(process.execPath, [serverPath], { | ||
| detached: true, | ||
| stdio: "inherit", | ||
| }); | ||
|
|
||
| child.unref(); | ||
| process.exit(0); | ||
| spawnDetachedServer(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,4 @@ | ||
| #!/usr/bin/env node | ||
| import { spawn } from "node:child_process"; | ||
| import { realpathSync } from "node:fs"; | ||
| import { dirname, join } from "node:path"; | ||
| import { spawnDetachedServer } from "@react-grab/utils/server"; | ||
|
|
||
| const realScriptPath = realpathSync(process.argv[1]); | ||
| const scriptDir = dirname(realScriptPath); | ||
| const serverPath = join(scriptDir, "server.cjs"); | ||
|
|
||
| const child = spawn(process.execPath, [serverPath], { | ||
| detached: true, | ||
| stdio: "inherit", | ||
| }); | ||
|
|
||
| child.unref(); | ||
| process.exit(0); | ||
| spawnDetachedServer(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,4 @@ | ||
| #!/usr/bin/env node | ||
| import { spawn } from "node:child_process"; | ||
| import { realpathSync } from "node:fs"; | ||
| import { dirname, join } from "node:path"; | ||
| import { spawnDetachedServer } from "@react-grab/utils/server"; | ||
|
|
||
| const realScriptPath = realpathSync(process.argv[1]); | ||
| const scriptDir = dirname(realScriptPath); | ||
| const serverPath = join(scriptDir, "server.cjs"); | ||
|
|
||
| const child = spawn(process.execPath, [serverPath], { | ||
| detached: true, | ||
| stdio: "inherit", | ||
| }); | ||
|
|
||
| child.unref(); | ||
| process.exit(0); | ||
| spawnDetachedServer(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,4 @@ | ||
| #!/usr/bin/env node | ||
| import { spawn } from "node:child_process"; | ||
| import { realpathSync } from "node:fs"; | ||
| import { dirname, join } from "node:path"; | ||
| import { spawnDetachedServer } from "@react-grab/utils/server"; | ||
|
|
||
| const realScriptPath = realpathSync(process.argv[1]); | ||
| const scriptDir = dirname(realScriptPath); | ||
| const serverPath = join(scriptDir, "server.cjs"); | ||
|
|
||
| const child = spawn(process.execPath, [serverPath], { | ||
| detached: true, | ||
| stdio: "inherit", | ||
| }); | ||
|
|
||
| child.unref(); | ||
| process.exit(0); | ||
| spawnDetachedServer(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,4 @@ | ||
| #!/usr/bin/env node | ||
| import { spawn } from "node:child_process"; | ||
| import { realpathSync } from "node:fs"; | ||
| import { dirname, join } from "node:path"; | ||
| import { spawnDetachedServer } from "@react-grab/utils/server"; | ||
|
|
||
| const realScriptPath = realpathSync(process.argv[1]); | ||
| const scriptDir = dirname(realScriptPath); | ||
| const serverPath = join(scriptDir, "server.cjs"); | ||
|
|
||
| const child = spawn(process.execPath, [serverPath], { | ||
| detached: true, | ||
| stdio: "inherit", | ||
| }); | ||
|
|
||
| child.unref(); | ||
| process.exit(0); | ||
| spawnDetachedServer(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,4 @@ | ||
| #!/usr/bin/env node | ||
| import { spawn } from "node:child_process"; | ||
| import { realpathSync } from "node:fs"; | ||
| import { dirname, join } from "node:path"; | ||
| import { spawnDetachedServer } from "@react-grab/utils/server"; | ||
|
|
||
| const realScriptPath = realpathSync(process.argv[1]); | ||
| const scriptDir = dirname(realScriptPath); | ||
| const serverPath = join(scriptDir, "server.cjs"); | ||
|
|
||
| const child = spawn(process.execPath, [serverPath], { | ||
| detached: true, | ||
| stdio: "inherit", | ||
| }); | ||
|
|
||
| child.unref(); | ||
| process.exit(0); | ||
| spawnDetachedServer(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,4 @@ | ||
| #!/usr/bin/env node | ||
| import { spawn } from "node:child_process"; | ||
| import { realpathSync } from "node:fs"; | ||
| import { dirname, join } from "node:path"; | ||
| import { spawnDetachedServer } from "@react-grab/utils/server"; | ||
|
|
||
| const realScriptPath = realpathSync(process.argv[1]); | ||
| const scriptDir = dirname(realScriptPath); | ||
| const serverPath = join(scriptDir, "server.cjs"); | ||
|
|
||
| const child = spawn(process.execPath, [serverPath], { | ||
| detached: true, | ||
| stdio: "inherit", | ||
| }); | ||
|
|
||
| child.unref(); | ||
| process.exit(0); | ||
| spawnDetachedServer(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated server initialization across 7 provider packages
Medium Severity
All 7 provider server files contain identical boilerplate:
--secureflag parsing, version check fetch, andconnectRelaycall. The PR extracted CLI logic intospawnDetachedServerbut didn't apply the same pattern here. A utility likestartProviderServer(handler, source)in@react-grab/utils/serverwould consolidate this duplication.