On Wed, Aug 5, 2015 at 10:14 AM, Idan Shimon <
idan...@gmail.com> wrote:
> Hi i am interested to setup my own socket protocol against a peripheral
> device
> The socket server would be online and exposed to the web, however it will
> not work on http.
not as it is currently.
the issue is that Django is a WSGI app, and Nginx doesn't pass TCP
connections, it parses HTTP and passes it to the Python stack (via
FastCGI, uWSGI, HTTP, etc). Even if the backend connection is HTTP,
it's a "reconstructed" http after being interpreted by the frontend.
if your protocol is not HTTP but it's roughly request-response, then
you might be able to create a frontend that calls Django (or any WSGI
app) in the back. Maybe by hacking gunicorn, or creating a uWSGI
plugin, or using the new async capabilities in the latests Python
versions... but it would be the current stack as is.
--
Javier