Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conntecting to a pusher-server with specific host, wsPort and wssport #3

Open
s1r-mar71n opened this issue Sep 10, 2018 · 1 comment
Assignees

Comments

@s1r-mar71n
Copy link

Is it possible to connect to a specific server with this library?

I am trying to port a nodejs implementation in order to improve performance, and those are the required fields:
apikey,
encrypted,
wsPort,
wssPort,
host.

@BenPope BenPope self-assigned this Oct 3, 2018
@BenPope
Copy link
Owner

BenPope commented Oct 3, 2018

I apologise for not getting back to you earlier.

This library prefers to follow the pattern of the other SDKs by taking a parameter for the cluster and building the rest of the address from there, e.g.,: https://github.com/BenPope/pusher-cpp/blob/master/pusher%2B%2B/include/pusher%2B%2B/client.hpp#L47

I will note that TLS isn't implemented yet; unfortunately I never tested it, and due to the templated nature of the library, it requires a separate implementation that has more steps (the TLS handshake if I recall) to work with TLS.

One way to provide a clean API over TLS and non-TLS is to implement the TLS implementation as a sub-library (the way ASIO and Beast do) and then type-erase that with a constructor that can support encryption or not.

This isn't something I find a great deal of time to work on, it's currently more of a proof of concept of an implementation in C++ that can support concurrency and TLS for those that already know ASIO. PRs welcome, etc.

The plan was to continue to work on it. I have some ideas for a much higher level implementation that pushes the pub-sub model beyond server support and into subsets of the json response with a unified api. Well, dreams.

To be honest, I built this over a weekend, prior to joining Pusher, as a talking point for the interview; a C++ SDK hasn't had much interest in general and my spare time since has been more sparse than expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants