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
Support for Lambda Response Streaming #1681
Comments
As serverless-offline added experimental supports for ALB and not just API Gateway, it could be argued that support for Lambda Function URLs could fit inside this project scope. Many users may be migrating from REST/HTTP API Gateway to Function URLs, and there seems to be no valid alternatives for local development today. To simulate AWS environment, Lambda Function URLs do require hostname or port based routing, as when function is exposed via Function URL, any HTTP method and request path invokes the Lambda function. Adding path-prefix in serverless-offline to expose different functions will introduce different behavior than the simulated AWS environment. Lambda Function URL can be set in buffered or streaming mode. To support streaming mode in serverless-offline with Lambda In-Process runner we have to:
Based on some tests done in AWS environment, both decorated and un-decorated handlers can be invoked via function URLs in both invoke modes. I am slowly working on this to allow local development for streaming responses. |
Any update on this? |
Any updates on this? I can see that RESPONSE_STREAM is supported however I get the same error when trying to call the function locally using Thanks! |
+1 |
+1 Same problem here. |
+1 Same problem: "errorMessage": "underlyingStream.setContentType is not a function",
"errorType": "TypeError",
"stackTrace": [
"TypeError: underlyingStream.setContentType is not a function" |
Any movement on this? |
Feature Request
Lambda has just released Lambda Response Streaming! It uses
Transfer-Encoding: chunked
to stream data back to the client. It's an extremely useful feature for my team, and I wish we could test it offline.Note: It only works through Lambda Function URLs, but serverless-offline doesn't support them.
If a solution is not possible, then a workaround would be highly appreciated
Sample Code
Expected behavior/code
Currently serverless-offline doesn't support Lambda URLs, so I have to do it through API gateway. This is what happens:
Ideal solution: It provides me with a Lambda URL to use.
Minimal solution: I'm able to use it through API Gateway.
Additional context/Screenshots
Here are the contents of
UserFunction.js
: https://gist.github.com/serg06/0653a4c690a7f5854f8038e3ebe62a64The text was updated successfully, but these errors were encountered: