SDN: Sending a packet from Ryu controller directly to host - hidden

Is it possible to send a data packet from controller directly to the host? I'm using a Ryu controller in my application and I want to create the covert channel where I can send some data between controller and host.

Related

Get constant incoming post requests from multiple devices with Django Rest Framework or listen TCP Server Socket

I have IoT devices which are rfıd readers. This devices send stream data with HTTP Post message. I use Django to get data from these devices. While receiving this data, I can write a function to get data from post requests coming directly with Django and receive the data from the request in this function with Django REST Framework or I can listen with a TCP Server socket. Which of these two approaches is more suitable for retrieving data? Because when I use a TCP Server socket, Django REST Framework does not work for HTTP requests, only the TCP socket works.

Flask - websocket doesn't work correctly in a real server

I've developed a WebApp with Flask, where different threads check a status and, if something changes they send a new json to the client. Then the client, with the javascript, can update the html page.
Running the app in my LAN, different clients connect and everything work correctly.
If I run the app on a real server (such as AWS, by using "flask run --host=0.0.0.0" ), the clients can connect and show the web page, but they don't receive the json sent by the socket of the webapp.
In the WebApp, a thread sends the new json by calling a function that uses:
socketio.emit('update', {'number': new_json_FE}, namespace='/test')
While the javascript receives this message (and does something) in this way:
socket.on('update', function(msg) { ....}
It is very strange that the clients connected in the LAN receive correctly all the json sent by the socket, while in the web not: they only receive the json when they connect to, and I have to upload the page (they don't receive the socket messages).
Can you help me?
Thank you very much!
I would advise against the use of threads like you have described for this situation.
Instead I would probably create a new program, StatusUpdater, that is always running and which is connected via socket to your Flask-SocketIO backend. When it finds a change in status it sends w/e signal or payload it needs to, through a socket, to the Flask-Socketio server. The SocketIO server upon receipt of this StatusUpdater payload can then send a broadcast to all connected clients notifying the client of the update.

Django Channels listening TCP/UDP

I have a GPS tracker that communicates with TCP protocol. The data will be send to web client via Websocket. I also need to persist it to database.
I intent to use Django as my main framework for this. But the problem is the TCP protocol.
Can django channel listen to TCP/UDP protocol?? Or should I use asyncio and then send it to django channels applications via ASGI??

Serve request by sending to loopback

We have a legacy server that receive requests in 2 ways:
Http REST requests via Jetty
Raw TCP sockets
We have a new requirement to process a raw request (delivered via TCP) and delegate this request to be processed by Jetty internally as if it would arrived via regular HTTP request.
Is that possible?
If not I guess the naive way would be to create an HTTP client and post it to ourselves as soon as we get data on the TCP socket.

Call webservice from gps device

I have a web service which I want to call from GPS device. I have hosted this web service on hosted server and this web service has a method called upload. This method accept a string parameter.
Currently I am calling this web service from a mobile phone with this url http://www.abc.com/Default.asmx/Upload?str=1,73.0667,33.6
Now I want to call this web method from GPS device, the problem is that GPS device accept only IP address and port no. It does not accept URL and web method.
Create a proxy service which is callable by the GPS device ("IP address and port no."), which in turn makes the desired webservice call, does whatever formatting to the data is needed, and returns it to the GPS device in whatever format you want it for the GPS device.