Hi @jkarneges, I need to be able to tell from my backend whether or not a client is "online", and the client should be able to update its status to "offline" even if it's still connected to Pushpin (over WebSocket). One way to do this is to publish a message from the backend that the client expects and responds to, and then wait for this response in the backend, but this is not synchronous and I was wondering if a better approach was possible using Pushpin.

@jkarneges How do you test your app when you answer the http request with ws.send(...) and you broadcast a message to a channel with expressGrip.publish(..., ...) in the same function? How do you test whether the boradcasted message is right?

@smtchahal if you're building user presence, I think it's best to develop that mostly outside of Pushpin. it's tempting to want to use the existence of a TCP connection (and thus, subscription) as an indicator of presence, but in practice this often leads to ghosting

I suggest having a presence table in your DB, with timestamp. clients ping the server periodically and you keep the data in the table. a client is online if it's in the table with a recent timestamp (e.g. within the past 30 seconds or whatever you decide is acceptable)

in a way, the actual tracking of presence isn't really a push problem. informing others about presence changes is though, and that's where Pushpin could come in

@jkarneges Thanks. I'm trying to run a pushpin docker container with the --net="host" parameter: docker run -dt --name pushpindev --net="host" pushpindev. In the dockerfile there is a variable which is set: ENV target app:8080 and used here CMD ["sh", "-c", "/usr/bin/pushpin --merge-output --port=7999 --route=\"* ${target},over_http\""]. I want to "link" the pushpin docker container with my host system directly so that it connects with my app which I'm debugging on my host system. Tried to use localhost, 127.0.0.1 and the local ip address of host system. Nothing does work. I don't receive any requests in my docker container. What I'm doing wrong? My build command: docker run -dt --name pushpindev --net="host" pushpindev. Thank you.

Hm. I'm doing something wrong. My app listens on the port 8080 but when I run the container with the following command docker run -dt --name pushpindev --net=host -e target=localhost:8080 pushpindev the container still does not receive any requests but my app answers on direct 8080 http reqests.