Open
Conversation
Common pattern: serve HTTP and WebSocket on the same port so a single ngrok endpoint handles both protocols. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
kaganjd
commented
Apr 24, 2026
|
|
||
| ## 2. Create the server | ||
|
|
||
| HTTP and WebSocket share the same port. |
Agent-Logs-Url: https://github.com/ngrok/ngrok-docs/sessions/f5cfcec8-bcfa-46df-9dfb-65b97ea11c67 Co-authored-by: kaganjd <9204835+kaganjd@users.noreply.github.com>
kaganjd
commented
Apr 24, 2026
| @@ -6,3 +6,54 @@ description: ngrok HTTP endpoints support WebSockets without any special configu | |||
|
|
|||
| WebSocket endpoints work through ngrok's HTTP endpoints without any changes. | |||
Contributor
Author
There was a problem hiding this comment.
@copilot add a line after this sentence that says "If you want to use WebSockets with HTTP, you only need one ngrok endpoint: you can start a server where listeners for both protocols share a single port."
Contributor
There was a problem hiding this comment.
Done in 3f22611 — added the sentence after line 7.
kaganjd
commented
Apr 24, 2026
| server.listen(8000); | ||
| ``` | ||
|
|
||
| A single ngrok endpoint handles traffic for both protocols. |
Agent-Logs-Url: https://github.com/ngrok/ngrok-docs/sessions/cc6f7347-68a2-4610-a897-db39f2b5acc2 Co-authored-by: kaganjd <9204835+kaganjd@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ngrok/ngrok-docs/sessions/9a5bbb71-7f4b-493b-bbd9-bdaf6313b584 Co-authored-by: kaganjd <9204835+kaganjd@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Test plan
ngrok.com/docs/using-ngrok-with/websocketsrenders the new sections correctly🤖 Generated with Claude Code