Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>"I had to implement Websockets recently and was totally confused as to the right way of doing it. I ended up evaluating NodeJS and Go for this function, and went with Go."

You had to implement Websockets in Python? Instead of using an already-functioning, tested library?



At $work, we call these people "problem solvers".


I'm guessing they meant they implemented a websockets application, not the actual protocol.


I'm guessing that too as I had a similar issue in a hobby web project in Python. I wanted instant messaging between users and the time required to read the docs for twisted and port the whole thing over was off putting. I ended up making a message server with Node and Socket IO that's like 50 lines and sends messages to and from clients and the server. It works but it seems a bit of a kludge.


It's this simple if you had come across Tornado:

    class WebSocketHandler(tornado.websocket.WebSocketHandler):
        def on_message(self, message):
            self.write_message("Echo: %s" % message)
I think the problem is that you chose a pretty heavyweight / complicated library.


Ta - maybe I'll give that a go. I didn't really try it. Actually I did glance at some docs for the framework I was using, web2py and it suggested some stuff with Tornado but one version only worked on chrome and another needed flash so presumably wouldn't work with iOS so I thought sod it - node/socket IO is easy and works anywhere.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: