I
I
ILE2016-03-25 15:53:57
JavaScript
ILE, 2016-03-25 15:53:57

How to pass websocket client to master process in nodejs?

Good afternoon!
I am working with sockjs. When a stream object (client) arrives, I send it through the worker to the master process.
process.send({ client: connection })
connection is a stream object (client).
And when I call the send method, I get an error:

internal/child_process.js:609
var string = JSON.stringify(message) + '\n';
                      ^
TypeError: Converting circular structure to JSON
.
With ordinary objects, everything is fine. Tell me how to fix

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2016-03-26
@bingo347

Pass connection as the second parameter to process.send

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question