Features | Pricing | Documentation | Contact | Blog | About

Now Available: Lambda Response Streaming

By Lee Harding | December 3, 2025 | 5 min read

Proxylity UDP Gateway now supports AWS Lambda's response streaming mode for Lambda destinations. When enabled, your Lambda function can send reply packets back to remote UDP clients progressively throughout its execution, rather than buffering all responses until completion. This unlocks new patterns for implementing UDP protocols that require sustained bidirectional communication or rapid acknowledgment.

How Response Streaming Works

In standard Lambda invocation mode, your function processes a batch of UDP packets, builds a complete response containing all reply packets, and returns. UDP Gateway receives the entire response, then transmits the reply packets back to the remote clients. This works well for simple request-response protocols.

With response streaming enabled, UDP Gateway invokes your function using Lambda's InvokeWithResponseStream API instead of the standard InvokeFunction API. Your function writes response packet objects to the stream as they become available. UDP Gateway reads from the stream and immediately transmits each reply packet to the corresponding remote client. The stream remains open for the entire duration of your function's execution.

This seemingly simple change enables protocols that were previously impractical or impossible with buffered responses.

Why This Matters

UDP protocols often have timing characteristics that don't map cleanly to synchronous request-response patterns. Response streaming addresses several real constraints:

Time-Sensitive Acknowledgments

Some protocols expect rapid acknowledgment of receipt before proceeding with subsequent messages. DNS over UDP, TFTP handshakes, and certain gaming protocols fall into this category. With buffered responses, the remote client waits for your entire Lambda function to complete before receiving any reply—even a simple ACK. Response streaming lets you send that acknowledgment immediately while your function continues processing, reducing time to first packet from seconds to milliseconds.

Progressive Query Results

Consider a device querying a catalog or fetching firmware metadata. The query might require database lookups, S3 object listings, or API calls to external services. With response streaming, you can send matching results as you find them rather than waiting for the complete result set. The remote client starts processing data sooner, and your function doesn't need to hold the entire result in memory.

Long-Running Operations with Status Updates

Some UDP-based device management protocols expect periodic status updates during long-running operations—think firmware updates, configuration validation, or device provisioning. Response streaming lets your function send incremental status packets (progress percentages, stage completions, error notifications) while the operation proceeds. The device receives real-time feedback instead of waiting silently for completion.

Single Request, Multiple Responses

Some protocols naturally generate multiple response packets in reply to a single inbound request. A device might query for a list of available updates, triggering your function to stream back multiple update descriptors. Or a diagnostic command might request sensor readings, with your function streaming back results as it queries different systems. Response streaming lets you send these responses progressively as your function generates them, rather than buffering the complete list and sending it all at once.

Configuration

Enable response streaming by setting UseResponseStreaming to true in your Lambda destination arguments:

Configuration example (JSON):

{
  "DestinationArn": "arn:aws:lambda:us-east-1:123456789012:function:DeviceHandler",
  "Arguments": {
    "UseResponseStreaming": true
  }
}

Your Lambda function must be implemented as a response streaming function according to AWS's guidance. The function writes response packet objects to the stream using the same JSON structure as buffered responses—a Replies array containing packet objects with Tag, Payload, and optionally Destination properties.

CloudFormation example:

MyDestination:
  Type: Proxylity::UdpGateway::Destination
  Properties:
    DestinationArn: !GetAtt HandlerFunction.Arn
    Arguments:
      UseResponseStreaming: true
    BatchingConfiguration:
      MaxBatchSize: 50
      MaxBatchWindowSeconds: 2

As your function writes to the stream, UDP Gateway processes each reply packet and transmits it to the remote client. There's no buffering on the UDP Gateway side—the packet goes out immediately.

Practical Considerations

Response streaming isn't a universal solution. For simple request-response protocols where all replies are generated quickly, buffered responses remain simpler and more cost-effective. Streaming introduces overhead and complexity that only makes sense when you actually need progressive delivery.

Lambda charges additional bandwidth fees for bytes streamed beyond the first 6 MB. The first 6 MB streams at uncapped bandwidth; responses larger than 6 MB stream at up to 2 MB/s. For typical UDP packet sizes and reasonable response volumes, this cost is negligible. But for high-volume scenarios with large response payloads, verify the economics work for your use case.

Response streaming requires your function to be implemented with Lambda's streaming response handler pattern. AWS currently supports this in Node.js runtimes and custom runtimes implementing the Runtime API. If you're using other languages, you'll need to either use a custom runtime or wait for AWS to expand native support. Check AWS's response streaming documentation for current runtime availability.

Getting Started

Lambda response streaming support is available now in UDP Gateway across all AWS Regions where both UDP Gateway and Lambda response streaming are supported.

To use it, enable UseResponseStreaming in your Lambda destination configuration and implement your function as a streaming response handler. For complete details on the response packet format and streaming implementation patterns, see the Lambda destination documentation.

We're excited to see what protocols and patterns you build with this capability. The combination of Lambda's flexible compute with real-time UDP packet delivery opens up implementation approaches that simply weren't feasible before.

Ready to modernize your UDP backends?

Get started with Proxylity UDP Gateway today. No upfront costs ‐ pay only for what you use.

Buy with AWS Try the Examples Explore Documentation