Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
ef9883f100 | |||
99db788d11 | |||
f7966e1f58 | |||
9828f7bc13 | |||
dab87b274d | |||
85171cb736 | |||
0fd5e0a209 | |||
eadab07f17 | |||
378592acc3 | |||
f885e49e34 | |||
078730153d | |||
4467ab76aa | |||
a0bbf31f75 | |||
13e9ac7a98 |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@apiglobal/typedserver",
|
||||
"version": "2.0.58",
|
||||
"version": "2.0.65",
|
||||
"description": "easy serving of static files",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
@ -46,7 +46,7 @@
|
||||
"@pushrocks/smartenv": "^5.0.5",
|
||||
"@pushrocks/smartfeed": "^1.0.11",
|
||||
"@pushrocks/smartfile": "^10.0.25",
|
||||
"@pushrocks/smartlog": "^3.0.1",
|
||||
"@pushrocks/smartlog": "^3.0.2",
|
||||
"@pushrocks/smartlog-destination-devtools": "^1.0.10",
|
||||
"@pushrocks/smartmanifest": "^2.0.2",
|
||||
"@pushrocks/smartmime": "^1.0.5",
|
||||
@ -70,7 +70,7 @@
|
||||
"@gitzone/tsbuild": "^2.1.66",
|
||||
"@gitzone/tsbundle": "^2.0.8",
|
||||
"@gitzone/tsrun": "^1.2.42",
|
||||
"@gitzone/tstest": "^1.0.72",
|
||||
"@gitzone/tstest": "^1.0.74",
|
||||
"@pushrocks/tapbundle": "^5.0.8",
|
||||
"@types/node": "^20.3.3"
|
||||
},
|
||||
|
43
pnpm-lock.yaml
generated
43
pnpm-lock.yaml
generated
@ -33,8 +33,8 @@ dependencies:
|
||||
specifier: ^10.0.25
|
||||
version: 10.0.25
|
||||
'@pushrocks/smartlog':
|
||||
specifier: ^3.0.1
|
||||
version: 3.0.1
|
||||
specifier: ^3.0.2
|
||||
version: 3.0.2
|
||||
'@pushrocks/smartlog-destination-devtools':
|
||||
specifier: ^1.0.10
|
||||
version: 1.0.10
|
||||
@ -101,8 +101,8 @@ devDependencies:
|
||||
specifier: ^1.2.42
|
||||
version: 1.2.42(@types/node@20.3.3)
|
||||
'@gitzone/tstest':
|
||||
specifier: ^1.0.72
|
||||
version: 1.0.72(@types/node@20.3.3)
|
||||
specifier: ^1.0.74
|
||||
version: 1.0.74(@types/node@20.3.3)
|
||||
'@pushrocks/tapbundle':
|
||||
specifier: ^5.0.8
|
||||
version: 5.0.8
|
||||
@ -438,8 +438,8 @@ packages:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/@gitzone/tstest@1.0.72(@types/node@20.3.3):
|
||||
resolution: {integrity: sha512-p8oBgHu5qg6hR9kn3nS2e6uBOgQMqIspJXAqEkD+U2Ios/uQwhC9+vkB9TlcVLeqdfZrZiglBSmeyl3f32wtpw==}
|
||||
/@gitzone/tstest@1.0.74(@types/node@20.3.3):
|
||||
resolution: {integrity: sha512-6V8bsfvpnODWqrkdooVqcOS1z5GA8dMDnLCOHnr/SUTeie3ox8KGpckwiZ+gTfz9WvzX6+KLVTZNYKGOaNbmMQ==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
'@gitzone/tsbundle': 2.0.8
|
||||
@ -449,12 +449,11 @@ packages:
|
||||
'@pushrocks/smartdelay': 2.0.13
|
||||
'@pushrocks/smartexpress': 4.0.35
|
||||
'@pushrocks/smartfile': 10.0.25
|
||||
'@pushrocks/smartlog': 3.0.1
|
||||
'@pushrocks/smartlog': 3.0.2
|
||||
'@pushrocks/smartpromise': 3.1.10
|
||||
'@pushrocks/smartshell': 2.0.30
|
||||
'@pushrocks/tapbundle': 5.0.8
|
||||
'@types/figures': 3.0.1
|
||||
figures: 4.0.1
|
||||
figures: 5.0.0
|
||||
transitivePeerDependencies:
|
||||
- '@swc/core'
|
||||
- '@swc/wasm'
|
||||
@ -696,7 +695,7 @@ packages:
|
||||
resolution: {integrity: sha512-nv2Ldy+jTRsVpGpOz+9o0F8FMELoWYk/sy5ecyh9AsP97Kdj3CtqwRwHhcl7mLepdrcRw1qHK3DAloln1XP4Vg==}
|
||||
dependencies:
|
||||
'@pushrocks/lik': 6.0.2
|
||||
'@pushrocks/smartlog': 3.0.1
|
||||
'@pushrocks/smartlog': 3.0.2
|
||||
'@pushrocks/smartparam': 1.1.6
|
||||
'@pushrocks/smartpromise': 3.1.10
|
||||
'@pushrocks/smartrx': 2.0.27
|
||||
@ -839,25 +838,18 @@ packages:
|
||||
resolution: {integrity: sha512-tXqwfrekGxGZJB72BFQppywk7413hXVDgcJNeU+kY6xvmzVjf2HxOMbFYhewh1+p4uai1u9n0xcMb0qbbPy4/Q==}
|
||||
dependencies:
|
||||
'@apiglobal/typedrequest-interfaces': 1.0.20
|
||||
dev: false
|
||||
|
||||
/@pushrocks/smartlog-interfaces@3.0.0:
|
||||
resolution: {integrity: sha512-yjppiLLJHBcrXTJJusDbFTvHq0RTMl3LnhvWAhyyy8U0O4VkJxIls1t5mS6jsEwxogP88+0flQIWknNJeB913A==}
|
||||
dependencies:
|
||||
'@apiglobal/typedrequest-interfaces': 2.0.1
|
||||
dev: true
|
||||
|
||||
/@pushrocks/smartlog@3.0.1:
|
||||
resolution: {integrity: sha512-lE6BCrtZcDDjeXymHq9EK+VlrV3lhXXagFubgHiwrtX8+2xzihS3PpLE54pMARf5X5LE00xg1W0QxSzYJ9oMqg==}
|
||||
dependencies:
|
||||
'@pushrocks/isounique': 1.0.5
|
||||
'@pushrocks/smartlog-interfaces': 2.0.23
|
||||
|
||||
/@pushrocks/smartlog@3.0.2:
|
||||
resolution: {integrity: sha512-1WPA0LX9HfE54ESKtk32uvsXiYIMu2QX7NUlQ3uHSMmFULnJYo2m/LeKEf6qHH7DJtxZbkWzkrMOkZVPL1MeNg==}
|
||||
dependencies:
|
||||
'@pushrocks/isounique': 1.0.5
|
||||
'@pushrocks/smartlog-interfaces': 3.0.0
|
||||
dev: true
|
||||
|
||||
/@pushrocks/smartmanifest@1.0.8:
|
||||
resolution: {integrity: sha512-inHmTp58Z8xl+c6mdOrfxc9IjUKuqho1i+WUI74G7rn6HwEn3cMd/06R1v80Xlx+95EYWzBwnYtuo7j7DafrdQ==}
|
||||
@ -1016,7 +1008,7 @@ packages:
|
||||
'@pushrocks/smartenv': 5.0.5
|
||||
'@pushrocks/smartexpress': 4.0.35
|
||||
'@pushrocks/smartjson': 5.0.6
|
||||
'@pushrocks/smartlog': 3.0.1
|
||||
'@pushrocks/smartlog': 3.0.2
|
||||
'@pushrocks/smartpromise': 3.1.10
|
||||
'@pushrocks/smartrx': 3.0.2
|
||||
'@pushrocks/smarttime': 4.0.1
|
||||
@ -1313,13 +1305,6 @@ packages:
|
||||
'@types/qs': 6.9.7
|
||||
'@types/serve-static': 1.15.2
|
||||
|
||||
/@types/figures@3.0.1:
|
||||
resolution: {integrity: sha512-2OXodKWdNhYl+S+wCvlafqJbfMIVDfQZYX2wRyUOcRiEQpeJ9zU6cT7d+RbMpjS+/vmQ2cAUUL8gyGy1YxtLPw==}
|
||||
deprecated: This is a stub types definition. figures provides its own type definitions, so you do not need this installed.
|
||||
dependencies:
|
||||
figures: 4.0.1
|
||||
dev: true
|
||||
|
||||
/@types/finalhandler@1.2.0:
|
||||
resolution: {integrity: sha512-NgEZKOhxUSXkwNnWNaMXZaopQ5aFGPAYiEpEWIkQ6Dzc4iS0M1oQsvWne2t+ex9QZUAdTz/ZT4tOXJhWtP6mCw==}
|
||||
dependencies:
|
||||
@ -2453,9 +2438,9 @@ packages:
|
||||
dependencies:
|
||||
xml-js: 1.6.11
|
||||
|
||||
/figures@4.0.1:
|
||||
resolution: {integrity: sha512-rElJwkA/xS04Vfg+CaZodpso7VqBknOYbzi6I76hI4X80RUjkSxO2oAyPmGbuXUppywjqndOrQDl817hDnI++w==}
|
||||
engines: {node: '>=12'}
|
||||
/figures@5.0.0:
|
||||
resolution: {integrity: sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==}
|
||||
engines: {node: '>=14'}
|
||||
dependencies:
|
||||
escape-string-regexp: 5.0.0
|
||||
is-unicode-supported: 1.3.0
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@apiglobal/typedserver',
|
||||
version: '2.0.58',
|
||||
version: '2.0.65',
|
||||
description: 'easy serving of static files'
|
||||
}
|
||||
|
@ -105,7 +105,6 @@ export class Server {
|
||||
|
||||
// general request handlling
|
||||
this.expressAppInstance.use((req, res, next) => {
|
||||
req.setTimeout(60 * 1000);
|
||||
next();
|
||||
});
|
||||
|
||||
@ -219,25 +218,47 @@ export class Server {
|
||||
this.httpServer.on('connection', (connection: plugins.net.Socket) => {
|
||||
this.socketMap.add(connection);
|
||||
console.log(`added connection. now ${this.socketMap.getArray().length} sockets connected.`);
|
||||
const cleanupConnection = () => {
|
||||
|
||||
const closeListener = () => {
|
||||
console.log('connection closed');
|
||||
cleanupConnection();
|
||||
};
|
||||
|
||||
const errorListener = () => {
|
||||
console.log('connection errored');
|
||||
cleanupConnection();
|
||||
};
|
||||
|
||||
const endListener = () => {
|
||||
console.log('connection ended');
|
||||
cleanupConnection();
|
||||
};
|
||||
|
||||
const timeoutListener = () => {
|
||||
console.log('connection timed out');
|
||||
cleanupConnection();
|
||||
};
|
||||
|
||||
connection.addListener('close', closeListener);
|
||||
connection.addListener('error', errorListener);
|
||||
connection.addListener('end', endListener);
|
||||
connection.addListener('timeout', timeoutListener);
|
||||
|
||||
const cleanupConnection = async () => {
|
||||
connection.removeListener('close', closeListener);
|
||||
connection.removeListener('error', errorListener);
|
||||
connection.removeListener('end', endListener);
|
||||
connection.removeListener('timeout', timeoutListener);
|
||||
|
||||
if (this.socketMap.checkForObject(connection)) {
|
||||
this.socketMap.remove(connection);
|
||||
console.log(`removed connection. ${this.socketMap.getArray().length} sockets remaining.`);
|
||||
connection.destroy();
|
||||
await plugins.smartdelay.delayFor(0);
|
||||
if (connection.destroyed === false) {
|
||||
connection.destroy();
|
||||
}
|
||||
}
|
||||
};
|
||||
connection.on('close', () => {
|
||||
cleanupConnection();
|
||||
});
|
||||
connection.on('error', () => {
|
||||
cleanupConnection();
|
||||
});
|
||||
connection.on('end', () => {
|
||||
cleanupConnection();
|
||||
});
|
||||
connection.on('timeout', () => {
|
||||
cleanupConnection();
|
||||
});
|
||||
});
|
||||
|
||||
// finally listen on a port
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@apiglobal/typedserver',
|
||||
version: '2.0.58',
|
||||
version: '2.0.65',
|
||||
description: 'easy serving of static files'
|
||||
}
|
||||
|
Reference in New Issue
Block a user