Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

request-timeout-keepalive

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

request-timeout-keepalive

promised version of request adding ability to set TCP_KEEPINTVL and TCP_KEEPCNT so that request properly timeouts on invalid connections

  • 0.9.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

request-timeout-keepalive

drop in promise based replacement for 'request' module that makes it possible to specify underlying socket timeout (TCP_KEEPINTVL and TCP_KEEPCNT)

const request = require('request-timeout-keepalive')
let result =  yield request({
    url  : "http://url",
    qs   : {
        movie_uid: movieUid,
        trailer: true,
        user_uid: userUid,
        user_ip: userIP,
        expires_at: moment(movieData[0].expires).format('X'),
        max_stream_count: 3
    },
    timeout: 1500, // request timeout (in cases where connection is established but invalid)
    json : true
}, {
	keepAliveInitialDelay: 1000, // initial delay (msecs) when to start sending keepalive packets
	keepAliveInterval: 1000, // delay between packates (msecs)
	keepAliveProbes: 1 // how many failed packets are needed before timeout is fired
})

// result.response contains underlying response from 'request' module
// result.body contains underlying body from 'request' module

Keywords

FAQs

Package last updated on 25 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc