- It would be nice if the question was more specific.
See the official reference.
https://www.actionherojs.com/tutorials/web-server
https://www.actionherojs.com/tutorials/websocket-server
// websocket Server Options:
server: {
// authorization: null,
// pathname: '/primus',
// parser: 'JSON',
// transformer: 'websockets',
// plugin: {},
// timeout: 35000,
// origins: '*',
// methods: ['GET','HEAD','PUT','POST','DELETE','OPTIONS'],
// credentials: true,
// maxAge: '30 days',
// exposed: false,
},
In the case of websocket server timeout exists, but there is no option in web-server.
If you want the process(server) to run only for a set amount of time, see below
const cp = require('child_process')
const path = require('path')
// Create the child
let child = cp.fork(path.join(__dirname, './actionhero.js'), [])
// Kill after "x" milliseconds
setTimeout((x) => {
child.kill()
}, x);
AWS 502 Error in load balancer
ref : https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-troubleshooting.html
HTTP 502: Bad gateway
Possible causes:
The load balancer received a TCP RST from the target when attempting to establish a connection.
The load balancer received an unexpected response from the target, such as "ICMP Destination unreachable (Host unreachable)", when attempting to establish a connection. Check whether traffic is allowed from the load balancer subnets to the targets on the target port.
The target closed the connection with a TCP RST or a TCP FIN while the load balancer had an outstanding request to the target. Check whether the keep-alive duration of the target is shorter than the idle timeout value of the load balancer.
The target response is malformed or contains HTTP headers that are not valid.
The load balancer encountered an SSL handshake error or SSL handshake timeout (10 seconds) when connecting to a target.
The deregistration delay period elapsed for a request being handled by a target that was deregistered. Increase the delay period so that lengthy operations can complete.
The target is a Lambda function and the response body exceeds 1 MB.
The target is a Lambda function that did not respond before its configured timeout was reached.