Skip to content

Allow custom WEBSOCKETS_NETWORK_TYPE #779

Open
@Naheel-Azawy

Description

@Naheel-Azawy

Hello,

I've been using this library and it's really impressive. Big thanks to the devs.
But now, I want to build my own WEBSOCKETS_NETWORK_TYPE.
I understand that this can be achieved by modifying WebSockets.h. But that would be dirty.

My suggestion, if not implemented somehow?, is to simply replace

...
#else
#error "no network type selected!"
#endif

with something like

...
#elif !defined(WEBSOCKET_ALLOW_CUSTOM_NETWORK_TYPE)
#error "no network type selected!"
#endif

Other checks can be optionally done for extra safety if you like.

I guess this would be nice to allow the user to define custom WEBSOCKETS_NETWORK_CLASS and others before including WebSockets.h.

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