Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client connection send and recv , not a nodejs client #8

Open
jhay06 opened this issue Apr 4, 2024 · 1 comment
Open

Client connection send and recv , not a nodejs client #8

jhay06 opened this issue Apr 4, 2024 · 1 comment

Comments

@jhay06
Copy link

jhay06 commented Apr 4, 2024

Hi , as the title says, i have an App i want to have nodejs serve the IPC server and Qt c++ as a client app , but how can i send data to ipc server ? is it a json ? if yes what is the signature /format of this json data to make net-ipc accept the sent data from client ?

@timotejroiko
Copy link
Owner

timotejroiko commented Apr 4, 2024

hey, the library uses a small header followed by either json or messagepack, optionally compressed by deflate, depending on the configuration.

connection starts at connection.js#_init() where the first 3 bytes of the payload are checked, if its "GET" treat as a websocket upgrade request, if its "IPC" accept the connection directly.

subsequent messages are tagged with a leading varint (variable-length integer) specifying message size, followed by the message itself. check interfaces.js#_write()

after decompression and decoding, the message itself has the following format:

{
    t: number, // message type
    d: any // message content
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants