-
Notifications
You must be signed in to change notification settings - Fork 9
feat: add http gateway support #233
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR implements HTTP gateway support for PocketIC instances by introducing "live" mode functionality. This allows automated time progression and the ability to test HTTP canisters through an HTTP gateway instead of only the PIC actor interface.
Changes:
- Added
makeLive()andstopLive()methods to PocketIC to enable/disable auto progress and HTTP gateway - Created a new HTTP example demonstrating the live mode functionality
- Updated the Todo example to showcase live mode usage with agent-js
Reviewed changes
Copilot reviewed 24 out of 26 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/pic/src/pocket-ic.ts | Added makeLive() and stopLive() methods with HTTP gateway port tracking |
| packages/pic/src/pocket-ic-client.ts | Implemented HTTP gateway and auto-progress client methods |
| packages/pic/src/pocket-ic-client-types.ts | Added type definitions for live mode requests/responses |
| packages/pic/src/http2-client.ts | Enhanced response handling for boolean returns and empty bodies |
| examples/http/* | New example demonstrating HTTP canister testing in live mode |
| examples/todo/tests/src/live-todo.spec.ts | New test demonstrating live mode with agent-js |
| dfx.json | Updated dfx version and added http canister configuration |
| package.json | Updated pnpm version and added http example test scripts |
| Cargo.toml | Added http example to workspace members |
| .node-version | Updated Node.js version |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR adds support for pocket ic "live" mode. This will enable auto progress and run an HTTP Gateway.