[aida] WebSockets behind a proxy

Phil (list) pbpublist at gmail.com
Fri Jun 17 13:12:54 CEST 2016


On Fri, 2016-06-17 at 12:18 +0200, Janko Mivšek wrote:
> Hi Phil,
> Unfortunately no docs for Swazoo, on the website there was just one
> example.

OK, good to know.

> I'm looking at the HTTPRequest>>readBodyFrom: and 8 byte read is only
> if 
> contentLength header is missing in update request. Is that so with 
> request from proxy? In this case it was expected that body of
> upgrade 
> request is exactly 8 bytes long, which was a case when I worked on
> that. 
> Is now different? How did you solve the problem, can you post a code?

Literally all I did was get rid of that logic so the method now reads:

readBodyFrom: aStream
	(self headers includesFieldOfClass: HTTPContentLengthField)
ifFalse: [ ^ nil ].
	self body: (aStream nextBytes: self contentLength).

Since it wasn't being used it seemed like just ignoring the body, if it
is present for upgrade requests, is safe to do and I haven't seen any
problems as a result of this change.


More information about the Aida mailing list