Skip to content

Commit d9ea5a9

Browse files
asambstackfrancisf
authored andcommitted
add: status endpoint for ws reconnect proxy
1 parent 2df59d7 commit d9ea5a9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/core/Proxy.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ class Proxy {
6464
headers: request.headers,
6565
};
6666
logger.info(`${HTTPLOG} Received http request ${options}`);
67+
const url = request.url;
68+
if(url.indexOf('/ws-proxy/status') > -1){
69+
response.writeHead(200, {'content-type': 'application/json; charset=utf-8', 'accept': 'application/json', 'WWW-Authenticate': 'Basic realm="WS Reconnect Proxy"'});
70+
response.end(JSON.stringify({"status" : "Running"}));
71+
return;
72+
}
6773
const proxyReq = http.request(options, (proxyResponse) => {
6874
response.writeHead(proxyResponse.statusCode, proxyResponse.headers);
6975
proxyResponse.pipe(response, {

0 commit comments

Comments
 (0)