Skip to content

microvms: document port_forward WebSocket endpoint - #1343

Merged
SSharma-10 merged 3 commits into
mainfrom
ksingh/microvms-port-forward
Nov 20, 2026
Merged

SSharma-10 merged 3 commits into
mainfrom
ksingh/microvms-port-forward

Conversation

@kishlay-singh-DO

Copy link
Copy Markdown
Contributor

Add GET /v2/microvms/{microvm_id}/port_forward?port=N. The endpoint upgrades to a WebSocket that carries one TCP connection to 127.0.0.1:N inside the MicroVM.

  • New operation, 101 upgrade response, port query parameter and a websocat code sample.
  • Options model lists the port_forward feature gate.
  • bad_request has an Invalid Port example.
  • The MicroVMs tag description mentions port forwarding.

Add GET /v2/microvms/{microvm_id}/port_forward?port=N. The endpoint
upgrades to a WebSocket that carries one TCP connection to 127.0.0.1:N
inside the MicroVM.

- New operation, 101 upgrade response, port query parameter and a
  websocat code sample.
- Options model lists the port_forward feature gate.
- bad_request has an Invalid Port example.
- The MicroVMs tag description mentions port forwarding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment on lines +109 to +117
required: true
description: >-
The TCP port to connect to inside the MicroVM. Port 50051 is reserved and
cannot be forwarded.
schema:
type: integer
minimum: 1
maximum: 65535
example: 8080

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description says 50051 is reserved, but the schema still allows it. Should we include this case in the Invalid Port 400 example?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point added a fix

SSharma-10 and others added 2 commits November 20, 2026 21:02
The port schema allows 1..65535, and the server rejects 50051 with
INVALID_ARGUMENT "port 50051 is reserved". Show that response as its own
example instead of narrowing the schema, because OpenAPI 3.0 needs `not`
for the exclusion and generated SDKs handle `not` poorly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@SSharma-10 SSharma-10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants