RaR
RaR

Reputation: 3223

Can I set IP header from node.js

There is a need to set DSCP values in packet headers in messages sent from node.js WebSocket. From the Wikipedia page, I understood I have to modify DS field in the IP header to set custom DSCP value. Is it possible to set it from node application and for some specific messages?

Upvotes: 0

Views: 720

Answers (1)

shaochuancs
shaochuancs

Reputation: 16246

Unfortunately, Node.js does not expose any IP level API (current version: v11.10.1). So you cannot set custom IP header only with JavaScript code.

However, in the Node.js application, you can write C/C++ addon to send the custom IP packet and integrate that addon in Node.js code.

Take module raw-socket for example, it writes raw network logic in C++ and expose that in JavaScript interface.

Upvotes: 1

Related Questions