When front-end JavaScript websockets send a JSON object, it looks something like this:
message_type: "1"
to: "umesh"
from: "moin"
body: ""
file: "{"filename":"reportesmtp.pdf"
,"fileextension":"application/pdf" ,"filesize":61813
,"filedata":"37,80,6848,52,48,57,....,10,37,37,69,79,70,10"}
"
message_id: "9"
message_stage_id: "0"
This data is sent using the following code:
//JavaScript
websocket.send(data)
After some modifications and being received by a server written in Golang at:
//Golang
websocket.JSON.Receive(u.Ws, &msg)
The above code gives errors such as:
err: unexpected end of JSON input
err: invalid character ',' after top-level value
err: invalid character ',' looking for beginning of value
However, everything works fine until the file size is approximately 35kb. The process is successful when not using socket.io.