websocket-level pings

This commit is contained in:
Doug Hoyte 2023-01-11 23:56:45 -05:00
parent 3009ac1305
commit efd40be1aa
2 changed files with 5 additions and 0 deletions

View File

@ -89,6 +89,9 @@ config:
- name: relay__maxWebsocketPayloadSize
default: 131072
noReload: true
- name: relay__autoPingSeconds
default: 55
noReload: true
- name: relay__queryTimesliceBudgetMicroseconds
default: 10000
- name: relay__maxFilterLimit

View File

@ -60,6 +60,8 @@ void RelayServer::runWebsocket(ThreadPool<MsgWebsocket>::Thread &thr) {
hubGroup = hub.createGroup<uWS::SERVER>(uWS::PERMESSAGE_DEFLATE | uWS::SLIDING_DEFLATE_WINDOW, cfg().relay__maxWebsocketPayloadSize);
if (cfg().relay__autoPingSeconds) hubGroup->startAutoPing(cfg().relay__autoPingSeconds * 1'000);
hubGroup->onHttpRequest([&](uWS::HttpResponse *res, uWS::HttpRequest req, char *data, size_t length, size_t remainingBytes){
LI << "HTTP request for [" << req.getUrl().toString() << "]";