Skip to content

How to dynamically switch between secure and non-secure connections #597

Open
@freitass

Description

@freitass

What is the recommended way to determine client connection security based on the uri? I'm interested in the actual implementation. It appears that websocketpp::client<websocketpp::config::asio_client> and websocketpp::client<websocketpp::config::asio_tls_client> are two completely unrelated types and, therefore, cannot be held by the same (smart) pointer.

I'm currently going for the approach of creating an abstract class ConnectionBase that is specialized for standard and secure connections. I then use the location object to choose between both specializations. It works, but results in far too much boilerplate code. I went over the examples and the only one that I found, echo_server_both, actually created two endpoints. Is there a better alternative?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions