HTTP request timeout

673 views
Skip to first unread message

Tom

unread,
Aug 28, 2011, 6:22:36 AM8/28/11
to Express
Good afternoon everyone,

I was wondering if anyone could tell me what the default HTTP request
timeout is when using express. What I mean by this is: after how many
seconds of dealing with a http request before ending it will the
server automatically close the connection?

How do I alter this timeout? I would like to set it to about 15
minutes for a special audio conversion route.

Thanks a lot.

Tom

David Ellis

unread,
Aug 28, 2011, 6:27:41 PM8/28/11
to Express
It looks like you want something like:

request.connection.setTimeout(15*60*1000);

Based on the Node.js 0.4.10 documentation:

http://nodejs.org/docs/v0.4.10/api/http.html#request.connection
http://nodejs.org/docs/v0.4.10/api/net.html#socket.setTimeout

David

Tom

unread,
Aug 28, 2011, 6:30:41 PM8/28/11
to expre...@googlegroups.com
Thanks David. I'm not entirely sure whether this is all there is to it though. From the docs:
"By default net.Socket do not have a timeout."

I'm quite positive I've heard that express times out after 2 minutes. Could anyone confirm or deny this?

Tom

2011/8/29 David Ellis <isv.da...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "Express" group.
To post to this group, send email to expre...@googlegroups.com.
To unsubscribe from this group, send email to express-js+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/express-js?hl=en.


TJ Holowaychuk

unread,
Aug 28, 2011, 6:31:27 PM8/28/11
to expre...@googlegroups.com
http.js, not express

-- 
TJ Holowaychuk

Tom

unread,
Aug 28, 2011, 6:32:33 PM8/28/11
to expre...@googlegroups.com
Thanks TJ,

Could you confirm whether setting this request.connection.setTimeout would do the trick?

Tom

2011/8/29 TJ Holowaychuk <t...@vision-media.ca>

TJ Holowaychuk

unread,
Aug 28, 2011, 6:33:29 PM8/28/11
to expre...@googlegroups.com
yeah it should. though I think req.connection might be deprecated,
or maybe it was req.socket, not sure

-- 
TJ Holowaychuk

Tom

unread,
Aug 28, 2011, 6:35:12 PM8/28/11
to expre...@googlegroups.com
Oh? In that case, what should be used instead?

TJ Holowaychuk

unread,
Aug 28, 2011, 6:35:59 PM8/28/11
to expre...@googlegroups.com
doesnt really matter, one of those, i prefer req.socket

-- 
TJ Holowaychuk
Reply all
Reply to author
Forward
0 new messages