> So on server side I'm using flask_socketio module. On the client side
> the relevant javascript code which establishes connection is:
I managed to get it to work, by RTFM.
I have
<script type="text/javascript">
var socket = io.connect('
http://localhost:7000',{'path':'/user0/
screw_socket.io' });
</script>
and then within brython part I can do for example:
window.socket.emit('savefile', {'content': whatever })
However my "gotcha" moment was that I initially had the "var socket = "
part in a jquery $(document).ready() call, and then it doesn't work
(this is mentioned in brython docs as well...)
Perhaps brython could come with some sort of
"brython_goodies.js", where a couple of popular js libraries
bindings would be provided (I'm thinking of ion.sound and
socket.io and
maybe something for key bindings as currently what's provided by
brython is not super convenient...) (it's a "spur of the moment"
suggestion, I didn't really think it through :-) )
Best,
Lukasz