I have looked at a lot of similar problems on message boards and read the related documentation and from what I can tell it seems like I am doing everything right.
node server code
io.on('connection', function(socket){
logger.log('info', `\n${Date().toLocaleString('short')}\n:: socket.io client connection established ::\nsocket.id: ${socket.id}\nsocket.handshake.address: ${socket.handshake.address}`)
socket.on('pythonTest', function(){
logger.log('info', `HI THIS IS PYTHON TALKING`)
});
socket.on('userConnect', function(userAgent){
logger.log('info', `\nhttp user connected\n${userAgent}`)
});
});
python client code
import socketio
from pprint import pprint
socket = socketio.Client()
socket.connect('http://localhost:3000')
pprint(vars(socket))
socket.emit('pythonTest', 'pythonTest')
When I launch the python script I can see that the socket connection works, however something is wrong with the event 'pythonTest'. The event 'userConnect' behaves as it should, but the emitter for 'userConnect' comes from a web browser which leads me to believe the problem is on the python side of things and not the event handler in node. Im thinking there is specifically something wrong with socket.emit('pythonTest', 'pythonTest') but I have no idea what it could be.