sitegui / nodejs-websocket

A node.js module for websocket server and client
MIT License
736 stars 155 forks source link

Nagle's Algorithm in nodejs-websocket ? #42

Closed Logstone closed 7 years ago

Logstone commented 7 years ago

Not really an issue, just a question. Does nodejs-websocket make use of Nagle's Algorithm? If so, how do I turn it off?

sitegui commented 7 years ago

Hello @Logstone

This module uses Node.js' core socket implementation. You can access the underlying socket object via the socket property

From Node docs:

By default TCP connections use the Nagle algorithm

So yes, websockets created with this lib have Nagle's algorithm on by default. You can change that via socket.setNoDelay([noDelay])