danthareja / node-google-apps-script

[DEPRECATED - use clasp instead] The easiest way to develop Google Apps Script projects
MIT License
353 stars 70 forks source link

Close connection to avoid waiting for timeout #41

Closed frapontillo closed 6 years ago

frapontillo commented 8 years ago

When using node-google-apps-script as a module dependency, I'd like to have the auth command return immediately after the user has logged in.

This is currently impossible since the http server uses keep-alive connections, that aren't immediately terminated when doing server.close().

The solution, used by the http-shutdown module is to close the socket underlying the IncomingMessage request.

lricoy commented 6 years ago

Hi @frapontillo . Thanks for the PR! Is req.socket.destroy() really necessary? I don't know if it will even work (haven't tried). According to the docs, after calling response.end() the property is nulled.

lricoy commented 6 years ago

Hi @frapontillo would #80 work for you?

frapontillo commented 6 years ago

No idea, it's been too long 😂

lricoy commented 6 years ago

Fixed in #80