Category : sockets

I have my API build with Django Rest Framework, I have read the docs (https://channels.readthedocs.io/en/stable/tutorial/index.html) but I am having troubles to implement for Rest Framework, so I need some human interaction. My app is an existing one so I must implement this with the existing "architecture" model-serializer-view. Is there any possibility to implement this real-time(using ..

Read more

I have a simple python script to receive requests from a Chrome extension. test_server.py: import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind(("localhost", 5100)) s.listen(1) while True: c, a = s.accept() request = c.recv(1024) data = request.decode() # Exception here print(data) response = "HTTP/1.0 200 OKnnHello World!" c.sendall(response.encode()) c.close() background.js (Chrome extension service worker): ..

Read more