--- src/lib/util/server_ws_impl.hpp.orig	2020-10-27 02:11:42.000000000 -0700
+++ src/lib/util/server_ws_impl.hpp	2023-03-09 20:00:24.000000000 -0800
@@ -9,6 +9,14 @@
 #include "asio.h"
 #include <asio/system_timer.hpp>
 
+// ### Newish asio API get_io_service is now MIA. ###
+#define NEW_ASIO_API 1
+#ifdef NEW_ASIO_API 
+#define GET_IO_SERVICE(s) ((asio::io_context&)(s).get_executor().context())
+#else
+#define GET_IO_SERVICE(s) ((s).get_io_service())
+#endif
+
 #include "server_ws.hpp"
 #include <unordered_map>
 #include <thread>
@@ -74,10 +82,10 @@
 
 		public:
 			virtual ~Connection() {}
-			explicit Connection(const std::shared_ptr<socket_type> &socket) : super(0), socket(socket), strand(socket->get_io_service()), closed(false) { }
+			explicit Connection(const std::shared_ptr<socket_type> &socket) : super(0), socket(socket), strand(GET_IO_SERVICE(*socket)), closed(false) { }
 
 		private:
-			explicit Connection(socket_type *socket): super(0), socket(socket), strand(socket->get_io_service()), closed(false) { }
+			explicit Connection(socket_type *socket): super(0), socket(socket), strand(GET_IO_SERVICE(*socket)), closed(false) { }
 
 			class SendData {
 			public:
@@ -361,7 +369,7 @@
 		std::shared_ptr<asio::system_timer> get_timeout_timer(const std::shared_ptr<Connection> &connection, size_t seconds) {
 			if (seconds == 0)
 				return nullptr;
-			auto timer = std::make_shared<asio::system_timer>(connection->socket->get_io_service());
+			auto timer = std::make_shared<asio::system_timer>(GET_IO_SERVICE(*(connection->socket)));
 			timer->expires_at(std::chrono::system_clock::now() + std::chrono::seconds(static_cast<long>(seconds)));
 			timer->async_wait([connection](const std::error_code& ec){
 				if(!ec) {
@@ -652,7 +660,7 @@
 
 		void timer_idle_init(const std::shared_ptr<Connection> &connection) {
 			if(config.timeout_idle>0) {
-				connection->timer_idle= std::make_unique<asio::system_timer>(connection->socket->get_io_service());
+				connection->timer_idle= std::make_unique<asio::system_timer>(GET_IO_SERVICE(*(connection->socket)));
 				connection->timer_idle->expires_from_now(std::chrono::seconds(static_cast<unsigned long>(config.timeout_idle)));
 				timer_idle_expired_function(connection);
 			}
