Closed SamVerschueren closed 6 years ago
Is the ttl on your listener's tokens one hour?
@dstuckims Thanks for the fast response! Where can I change this TTL? Can't seem to find it in the Azure Portal and it doesn't seem to be an option in the ws
library either.
I'm not very familiar with this node project yet (it's on my todo list). @clemensv may be able to provide some help here as well but it's likely this token update may need to be added to this azure-relay-node project.
The HybridConnection websocket protocol supports a listener "gesture" (JSON command) for renewing the token. It would entail the listener sending a new token like this around the time the previous token expires:
{
"renewToken" : {
"token" : "SharedAccessSignature sr=http%3a%2f%2fcontoso.servicebus.windows.net%2fhybrid1%2f&sig=XXXXXXXXXX%3d&se=1471633754&skn=SasKeyName"
}
}
So basically, after 1 hour, I will have to renew the token in order to keep the connection alive and to prevent it from being killed after 1 hour and 5 minutes?
Is this something you guys see to automatically handle inside hyco-ws
?
@SamVerschueren - Yes, that is correct. The library should do this today, so it is something that will have to be implemented. Technically the token should expire after an hour, but we allow for an hour and 5 minutes to account for potential clock skew.
@SamVerschueren, can you please indicate how you are setting the Token currently? Are you using environment variables process.env.SB_HC_KEYRULE
and process.env.SB_HC_KEY
or setting them like below?
var wss = WebSocket.RelayedServer(
{
// create the
server : WebSocket.createRelayListenUri(ns, path),
token: WebSocket.createRelayToken('http://'+ns, keyrule, key)
});
Like the below example.
So this was implemented half a year ago? Do I have to do something special in order for this to work?
I think this one can then be closed.
ping @dlstucki
It shouldn't take anything special in order for this to work. Issue can be closed.
Hi
I am using
hyco-ws
to subscribe a listener to a Relay. It works very well! But I noticed that my listener gets disconnected after 1 hour and 5 minutes. Every single time. There is nothing fancy about the error though so I can't really say where it's coming from.Does someone have any ideas as to what could cause these disconnects? Is it a timeout? Is it something else?
Thanks in advance!