These are chat archives for fanout/pushpin

10th
Aug 2018
Justin Karneges
@jkarneges
Aug 10 2018 02:55 UTC
yeah, passing \r\n is very obnoxious in the shell. I had to use strange syntax in my earlier example
I'm glad you figured it out :)
"0x20" is wrong syntax. it's always hex, without any leading indicator. so for length 32 just put "20"
Adrian
@picarsite
Aug 10 2018 06:49 UTC
@jkarneges I still get the same error with 20: curl -i -H "Content-Type: application/websocket-events" --data-binary $'OPEN\r\nTEXT 20\r\n{ type: "login", value: "uuid" }\r\n' http://localhost:8080/api/websocket -> Error: Read from empty buffer. at defineClass.isOpening.recvRaw
Justin Karneges
@jkarneges
Aug 10 2018 15:25 UTC
@picarsite are you checking canRecv() before calling recv()?
here's a similar formatted curl that works against one of our projects: curl -i -H "Content-Type: application/websocket-events" -H "Accept: application/websocket-events" --data-binary $'OPEN\r\nTEXT C\r\n/nick foobar\r\n' https://9h8j7cy642.execute-api.us-west-1.amazonaws.com/prod/chat
(the Accept header is needed because the project uses AWS API Gateway)
Adrian
@picarsite
Aug 10 2018 16:59 UTC
Yes, I'm checking canRecv() before recV() and my code is the same like in your example :'(
image.png
Justin Karneges
@jkarneges
Aug 10 2018 18:29 UTC
hmm I could be wrong but won't that call recv() twice?
Adrian
@picarsite
Aug 10 2018 19:42 UTC
@jkarneges Oh, I did not know that this could be a problem. Thank you, my request works now :)