Skip to content
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

pruntime: Sidevm incoming HTTP stream via pRuntime RPC #1366

Merged
merged 23 commits into from
Dec 4, 2023
Merged

Conversation

kvinwang
Copy link
Collaborator

@kvinwang kvinwang commented Aug 24, 2023

Description

This PR introduces the capability for SideVM instances to listen for incoming HTTP requests on a pRPC endpoint.

With this PR, SideVM instances gain the ability to receive incoming HTTP requests with a specific path pattern: /sidevm/<contract address>/<res_path>.

  • The body stream can be read/write asyncly. This allow the app to handle streaming API or to implement WebSocket in the app space.
  • The HTTP headers Cookie/Set-Cookie are filtered out for security reason as multiple contract would share the same HTTP origin.

Features/limitations of the stream:

  • Asynchronous reading and writing of the body stream is supported. This allows applications to efficiently manage streaming APIs and implement WebSocket within the app space.

  • HTTP headers Cookie and Set-Cookie are filtered out for security reasons, as multiple contracts share the same origin in the phat contract.

@kvinwang kvinwang force-pushed the sidevm-stream branch 2 times, most recently from 37ca8bd to d4831f0 Compare October 8, 2023 03:32
@kvinwang kvinwang marked this pull request as ready for review October 25, 2023 10:25
@kvinwang kvinwang changed the title Sidevm incoming HTTP stream via pRuntime RPC pruntime: Sidevm incoming HTTP stream via pRuntime RPC Nov 26, 2023
Copy link
Contributor

@h4x3rotab h4x3rotab left a comment

Choose a reason for hiding this comment

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

LGTM

crates/sidevm/host-runtime/src/rocket_stream.rs Outdated Show resolved Hide resolved
crates/sidevm/host-runtime/src/rocket_stream.rs Outdated Show resolved Hide resolved
crates/sidevm/host-runtime/src/env.rs Show resolved Hide resolved
@kvinwang kvinwang merged commit f9ba9ad into master Dec 4, 2023
8 checks passed
@kvinwang kvinwang deleted the sidevm-stream branch December 4, 2023 07:41
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