Closed ScottPierce closed 2 years ago
If you're not using Ruby, you can run the server via the binary. The method used for the JavaScript is simply a helper to turn the configuration into options for the JS client. So as long as the options provided to the binary server are used in the Android, Java, and iOS clients, specifically the web and socket host and port, it should "just work."
Hope that helps! Let me know if you have any issues.
So my plan is to just setup your docker container in my docker-compose local dev setup, point my clients at it, and I should be good to go?
That's what I thought. Awesome! Thanks!
Oh - you don't have a docker image. Looks like I can create an updated one based on https://github.com/gregeinfrank/docker-pusher-fake
So how should I configure this for the server?
Some options I have on the server sdk:
setHost
setCluster
setEncrypted
Some options i have on the client sdk:
setHost
setCluster
setUseTLS
I don't seem to have the ability to set the port as I thought, but perhaps I can set it through the host?
That doesn't really give me the ability to differentiate between a web
port and a socket
port though.
Oh - you don't have a docker image.
I'll look into adding an official one soon.
So how should I configure this for the server?
If you're using pusher-websocket-java, it looks like you can set the WebSocket port with setWsPort
or setWssPort
depending if you're using TLS or not. As far as I can tell it only uses HTTP for the HttpAuthorizer
, which isn't related to the fake.
For the client, it may be similar but I'm not sure which libraries you're using. I'd look into how they work, as they may also only use a WebSocket as well.
And of course you'd only need HTTP configured correctly if you're using any of the endpoints.
it looks like you can set the WebSocket port with setWsPort or setWssPort
Can't believe I missed that!
So here are the options:
$ pusher-fake --help
Usage: pusher-fake [options]
-i, --id ID Use ID as the application ID for Pusher
-k, --key KEY Use KEY as the key for Pusher
-s, --secret SECRET Use SECRET as the secret token for Pusher
--socket-host HOST Use HOST for the web socket server
--socket-port PORT Use PORT for the web socket server
-v, --[no-]verbose Run verbosely
--web-host HOST Use HOST for the web server
--web-port PORT Use PORT for the web server
--webhooks URLS Use URLS for the webhooks
setWsPort
and setWssPort
correspond to --socket-port
depending on whether or not setUseTLS
is true or false.setHost
to http://localhost
?setCluster
shouldn't matter?Do you think I should need to do anything else?
Yeah, you probably want to use setWsPort
and not use TLS locally to make it easier, otherwise you have to deal with SSL. And localhost
will work for the host assuming that's where it'll be available from Docker. You probably don't want setCluster
since it changes the host and ports.
Guessing you worked this out so going to close, but feel free to re-open if needed.
I see in your documentation for JS clients, you swap out the JS Client real instance for a fake instance. Is it possible to use this server with the Pusher Android and iOS clients?
My server is also java based, so I use the Java server sdk as well.
I see options in all the SDKs for setting host and port, so it seems like maybe yes, but then I'm not sure since your documentation doesn't say anything about this, and I don't understand why you'd be swapping out the JS client for a fake one.
I'd love your thoughts!