From 1fe4783d940cd8905b3f3cb03884890e887cd0c4 Mon Sep 17 00:00:00 2001 From: utf-4096 Date: Sat, 15 Jul 2023 13:20:12 +0200 Subject: [PATCH] feat: add KeepAlive packet NGINX really doesn't like it when the client doesn't send messages for a while. This prevents it from closing the connection. --- protobuf/2.0/Container.proto | 8 +++++--- protobuf/2.0/KeepAlive.proto | 7 +++++++ 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 protobuf/2.0/KeepAlive.proto diff --git a/protobuf/2.0/Container.proto b/protobuf/2.0/Container.proto index b544f28..c69255b 100644 --- a/protobuf/2.0/Container.proto +++ b/protobuf/2.0/Container.proto @@ -1,12 +1,13 @@ +syntax = "proto3"; + import "./Authentication.proto"; import "./Message.proto"; import "./PublishDiscover.proto"; - -syntax = "proto3"; +import "./KeepAlive.proto"; // Client <-> Server message Container { - required uint32 id = 1; + required uint32 id = 1; oneof message { AuthenticationRequest AuthenticationRequest = 2; @@ -16,5 +17,6 @@ message Container { PublishResponse PublishResponse = 6; DiscoverRequest DiscoverRequest = 7; DiscoverResponse DiscoverResponse = 8; + KeepAlive KeepAlive = 9; } } diff --git a/protobuf/2.0/KeepAlive.proto b/protobuf/2.0/KeepAlive.proto new file mode 100644 index 0000000..3c583eb --- /dev/null +++ b/protobuf/2.0/KeepAlive.proto @@ -0,0 +1,7 @@ +syntax = "proto3"; + +// Server <-> Client +// data: any data, server ignores this +message KeepAlive { + required uint32 data = 1; +}