Open vibhoothi opened 3 years ago
Hey @vibhoothiiaanand,
This was a long term coming. I will play with this tomorrow.
Hey @vibhoothiiaanand
I have created a websocket version of the script.
pip install autobahn[serializers]
pip install twisted
pip install service_identity
Install above modules and test the irccloud_ws.py
script and let me know if it indeed keeps you from logging out.
@vijaiaeroastro thanks for the quick turnaround,
I tried to see, on quick looks it looks like some issue in the way we are handling keeping connection,
Full logs:
I tried to see around online, on quick look I did not find any leads to fix-up, maybe due to handling of websockets
Exactly the same error, but this time on the self hosted
version (all required python3 libs are installed).
```python
$ IRCCLOUD_USERNAME="email@address.here" IRCCLOUD_PASSWORD="pa$$w0rd_h3r3" python3 irccloud_ws.py
2021-05-13 16:06:47,022 INFO Successfully obtained authentication token.
2021-05-13 16:06:47,752 INFO Successfully obtained a session id.
Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/twisted/python/log.py", line 103, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/log.py", line 86, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
---
After this works I'll submit some fixes
to the irccloud.self branch.
Hey @PeGaSuS-Coder,
Don't worry. Once the testing is finished. I will update both repositories 😃
@vibhoothiiaanand Will make sure this gets fixed somehow this week. I have never used websockets
in my personal work. Hence, i am struggling a bit 😃
Hi,
If you still need some help, I hacked a keep alive app in go which seems to be working.
websocket_host
and websocket_path
.websocket_host
from the previous step.
https://github.com/vijaiaeroastro/irccloud/blob/master/irccloud_ws.py#L88 The URL should be wss://$websocket_host/$websocket_path
also with the values from previous step.cookie
should be set with the session id that you fetch from here: https://github.com/vijaiaeroastro/irccloud/blob/master/irccloud_ws.py#L53
_method
should be auth
_reqid
should be set to 1 (or probably any integer would work){ "success": true, ... }
The complete go code can be found here: https://github.com/osm/icka/blob/master/main.go
Hey @osm,
Nice work. I am really not interested in maintaining this stuff anymore. Most of the simpler websocket libraries that i tried in Python simply suck when it comes to secure sockets and i hate using twisted for this. Even i was considering a Go based solution since Gorilla provides a nice implementation. But it wouldn't be fair to simply take your code in Go and put it in my repo either.
I will most likely not maintain these repositories anymore and redirect traffic to your repo 😃
I am not even on IRC anymore honestly. Only maintained this since it grew too popular.
Vijai
Hi,
Right now when we try to establish a connection we get sessionID and auth_token properly but we end up with 403 response, I tired to talk to IRCcloud feedback channel, itseems the HTTP method is deprecated, and we require to use/migrate to wss method.
https://github.com/irccloud/irccloud-tools/wiki/API-Overview#websocket