Authentication for streaming clients

This commit is contained in:
badaix 2025-02-08 23:06:56 +01:00 committed by Johannes Pohl
parent 937ec1c637
commit 035867d809
20 changed files with 302 additions and 132 deletions

View file

@ -1,6 +1,6 @@
/***
This file is part of snapcast
Copyright (C) 2014-2024 Johannes Pohl
Copyright (C) 2014-2025 Johannes Pohl
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -40,15 +40,17 @@ class StreamSessionTcp : public StreamSession
{
public:
/// ctor. Received message from the client are passed to StreamMessageReceiver
StreamSessionTcp(StreamMessageReceiver* receiver, tcp::socket&& socket);
StreamSessionTcp(StreamMessageReceiver* receiver, const ServerSettings& server_settings, tcp::socket&& socket);
~StreamSessionTcp() override;
void start() override;
void stop() override;
std::string getIP() override;
protected:
void read_next();
void sendAsync(const shared_const_buffer& buffer, const WriteHandler& handler) override;
/// Read next message
void readNext();
/// Send message @p buffer and pass result to @p handler
void sendAsync(const shared_const_buffer& buffer, WriteHandler&& handler) override;
private:
tcp::socket socket_;