/* * Copyright (c) 2021, Dex♪ * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include namespace WebSocket { class ConnectionInfo final { public: ConnectionInfo(URL::URL); URL::URL const& url() const { return m_url; } ByteString const& origin() const { return m_origin; } void set_origin(ByteString origin) { m_origin = move(origin); } Vector const& protocols() const { return m_protocols; } void set_protocols(Vector protocols) { m_protocols = move(protocols); } Vector const& extensions() const { return m_extensions; } void set_extensions(Vector extensions) { m_extensions = move(extensions); } struct Header { ByteString name; ByteString value; }; Vector
const& headers() const { return m_headers; } void set_headers(Vector
headers) { m_headers = move(headers); } // secure flag - defined in RFC 6455 Section 3 bool is_secure() const; // "resource-name" or "/resource name/" - defined in RFC 6455 Section 3 ByteString resource_name() const; private: URL::URL m_url; ByteString m_origin; Vector m_protocols {}; Vector m_extensions {}; Vector
m_headers {}; }; }