-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
I am running a Rails app in puma and using rack-streaming-proxy to proxy a MJPEG HTTP stream. The stream is a multipart message in chunked encoding. The proxy seems to break the stream by not proxying it as chunked encoding. All the code is here:
https://github.com/pedrocr/camerasink
Testing with telnet the original stream returns:
HTTP/1.0 200 OK
Server: camerasave
Date: Fri, 18 Apr 2014 11:13:06 GMT
Transfer-Encoding: chunked
Content-Type: multipart/x-mixed-replace;boundary=SurelyJPEGDoesntIncludeThis
51
--SurelyJPEGDoesntIncludeThis
Content-Type: image/jpeg
Content-Length: 9437
(the image contents go here, the headers after "51" are repeated on every new image)
The same stream after being proxied with rack-streaming-proxy and puma returns:
HTTP/1.0 200 OK
server: camerasave
date: Fri, 18 Apr 2014 11:12:16 GMT
content-type: multipart/x-mixed-replace;boundary=SurelyJPEGDoesntIncludeThis
Cache-Control: no-cache
X-Request-Id: c68247f6-e4ef-4507-b34c-c37330062289
X-Runtime: 0.256272
Connection: close
--SurelyJPEGDoesntIncludeThis
Content-Type: image/jpeg
Content-Length: 9427
(the image contents go here and the headers get repeated as well)
The difference seems to be that the proxied request doesn't have chunked encoding. At least in firefox this breaks the MJPEG streaming.
Metadata
Metadata
Assignees
Labels
No labels