Where to get Socket.io/Websocket server details - python

I am trying to connect to a socket.io server. According to the socket.io documentation (version compatibility),"the client and the server must use compatible versions for everything to work", else we get an error like this one here.Problem is, I dont know where to look for server's Engine.io/java/python protocol version on an open webpage Demo.tv. I can run pip freeze to get my socketio and engineio version, but I dont know if I have a webpage open, where do I get protocol versions of the server. example image

Related

Tryton web client version mismatch?

I am using GNU Health and I have installed trytond server 6.0.24 and tryton desktop 6.0.10 and when I install trytond web client it was installed successfully but when I open it on localhost it shows the error Version Mismatch.
How can I match the version of the tryton web client with the trytond server?
This is the error shown on the browser
I have tried to find to version of tryton web client but it never works.
The error is right, you installed the wrong version of the web client. You should install the 6.0 series of tryton-sao. Sao is the name of web client is not the same as the desktop client. For example, you can install the 6.0.27 version (which is the latest at time of writing) which should work for your setup. Note that you should also remove the current installed version to avoid conflicts.
This is because tryton requires all clients (web and desktop) to run the same series (two first digits of version) as the server you are connecting to.

Swift socket.io compatible version with server python-socketio

I've searched couple of days for it but found nothing to fix this issue.
My client is an iOS device running socket.io v15.2.0 (Oct 17, 2019).
I've followed this post (Implement a WebSocket Using Flask and Socket-IO(Python))
That post described how to connect to the python socket server with a javascript client but even the javascript client has also returned same error :|
Then I checked the compatibility table at this page and found out that the latest version only works with the javascript client versions of 3.x so I checked this website to see the latest version of javascript socket.io client and I changed the version to 3.0.4 then the JS client successfully connected to the python socket server 🥳.
BUT, there is no versioning table for iOS clients at the swift socket.io Github page
Is there any versioning table for iOS/Android clients to show which python-socketio version is compatible with the v15.2.0 of swift socket.io clients?
Error:
The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO)
127.0.0.1 - - [24/Dec/2020 13:29:15] "GET /socket.io/?transport=polling&b64=1 HTTP/1.1" 400 -
after testing many different version finally found the correct versioning to work with swift socket.io 15.2.0
here is the versions:
tornado==5.0
Flask-SocketIO==1.0.0
python-engineio==2.2.0
python-socketio==2.0.0
updated as today:
if you use python-socketio-5.7.1 as server, you need to update Socket.IO-Client-Swift 16.0.1

Raspberry Pi python app and nodejs socketio communication

My requirement is to communicate socketio with nodejs server to Raspberry Pi running a local Python app. Please help me. I can find ways of communication with web app on google but is there any way to communicate with Python local app with above mentioned requirements.
It's unclear exactly which part you need help with. To make a socket.io connection work, you do the following:
Run a socket.io server on one of your two computers. Make sure it is listening on a known port (it can share a port with a web server if desired).
On the other computer, get a socket.io client library and use that to make a socket.io connection to the other computer.
Register message handlers on both computers for whatever custom messages you intend to send each way and write the code to process those incoming messages.
Write the code to send messages to the other computer at the appropriate time.
Socket.io client and server libraries exist for both node.js and python so you can either type of library for either type of system.
The important things to understand are that you must have a socket.io server up and running. The other endpoint then must connect to that server. Once the connection is up and running, you can then send message from either end to the other end.
For example, you could set up a socket.io server on node.js. Then, use a socket.io client library for python to make a socket.io connection to the node.js server. Then, once the connection is up and running, you are free to send messages from either end to the other and, if you have, message handlers listening for those specific messages, they will be received by the other end.

Host a Python based Websocket server

I am looking to host a basic Websocket server.
The code I want to see running is : FastFlicker
Do you know how and where I can host this application online?
PythonAnywhere dev here. Unfortunate we can't host websocket-based apps on our site right now. The toggle you spotted enables/disables websockets for our in-browser consoles, it's not related to running your own websocket server.
I've added an upvote for websockets to our own issue tracker, but for now you'll have to use a different service :-(
Your solution is OpenShift, even with the free plan you can host FastFlicker.
Click Add Application, choose the good cartridges (Python 2.7).
Then use your gitHub repo url to get the source.
Once the application is running, you need to SSH it to change the address and the port (see this Post).
To be able to ssh you need first to generate a ssh key and to add it in setting on the website
Ok, now kill all processes that uses your port. (lsof -i :8080)
Start your application and now it's working!
(It is in app-deployments/current/repo/ for me, then python FastFlicker.py &)
It is currently hosted here : ws://main-fastflicker.rhcloud.com:8000/
And to test it, you know you can use this generic client..

Websocket library for python

Hi I need a websocket server in python which supports the protocol used in chrome 16(protocol version 13). Tornado and twisted are not working. Websockify works but i can't find any documentation for it. I need minimal setup means lesser imports. Please help me out here thanks in advance.
Maybe you could take a look to pywebsocket, it claims to support protocol version 13 and is designed for :
The pywebsocket project aims to provide a WebSocket standalone server
and a WebSocket extension for Apache HTTP Server, mod_pywebsocket.
Autobahn is another implementation of websockets :
Autobahn WebSockets for Python provides an implementation of the
WebSockets protocol which can be used to build WebSockets clients and
servers
ws4py : Websocket for python :
Python library providing support for the WebSocket protocol defined in
RFC 6455
Here are some examples of implementing a websocket server in Python. Be sure to read and apply the comments on the code of the following examples, because there may be some bugs:
http://popdevelop.com/2010/03/a-minimal-python-websocket-server/ : It has been tested on Chrome, according to the author of the code.
http://mumrah.net/websockets-in-python : At the end of this blog page, the author has included the URL to a Python implementation of a websocket server.
http://dev.enekoalonso.com/2010/05/22/more-websockets-now-with-python/: only works on Chrome, according to the author.
This page contains an implementation of a Python websocket server that can be used through imports:
https://github.com/AdrianGaudebert/python-websocket-server
You should know that the license for using this is MIT. It may only work with Python 3.0.
WebSocket Echo example works on Chrome/16.0.912.63.
It uses txWS a simple library for adding WebSockets server support to your favorite Twisted applications.
If you are still interested in using websockify, there is a simple example of using it to build an echo server included](https://github.com/kanaka/websockify/blob/master/tests/echo.py).
You can run it like this (from a websockify checkout):
./tests/echo.py 8080
The browse to localhost:8080/tests/echo.html. Enter localhost, 8080 for the WebSocket host and port and hit connect. You should see the client sending messages and the server echoing them back (with a "You said: " prefix).

Categories