Override 2 minute timeout in Restify

Restify wraps the core http server in nodejs.

I had a case where I needed to read in and process a large CSV file. The process would take about 5 minutes, but the rest client would be disconnected after 2 minutes.

When testing with curl as the client, I would get the response: curl: (52) Empty reply from server.

When testing with the request library as the client, I would get the response: { [Error: socket hang up] code: 'ECONNRESET' }.

After looking through the source, I saw that the http server was a property named server on the restify server object.

The solution was easy after that:

var server = restify.createServer(myconfig);

// Set timeout in milliseconds. This would be 5 minutes.
server.server.setTimeout(60000*5);

Hopefully this saves others some time.