Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var http = require("http")
- http.createServer(function (req, res) {
- // let it time out
- // just hold the connection open forever
- }).listen(8080)
- var r = http.createClient(8080, "localhost").request("GET", "/", {})
- r.on("response", function (res) {
- console.log("got response")
- })
- r.connection.setTimeout(100)
- r.connection.on("timeout", function () {
- console.log("timeout!")
- })
- r.end()
Add Comment
Please, Sign In to add comment