Python Forum
Detect http request on my ip
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Detect http request on my ip
#1
I want to write a python script that detects when a http request is made on the IP address of my home network. I have a dynamic DNS set up so that I can access my little home server any time.
I want to execute code after the http request is made and make check on the payload if it is a POST.

I'm new but not new at networking stuff so I don't know where to start. I always had no problems making http requests and thought that it would be easy to detect them.

Can anyone guide me in the right direction?
Reply
#2
Well, think about it: when you make an HTTP request, you do so to a server, don't you? So, you need to be running an HTTP server that will listen for requests and do what you want with them. There are a number of web frameworks that allow you to write web applications that handle HTTP requests and return responses - Flask, Django, Bottle, CherryPy are some of them. These often have a server you can use while developing, but may not be recommended for production use. In those cases, you'll want to run your application using a WSGI server (for example, Gunicorn is one available for UNIX, but there are others).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Http connection error when using API request (requests library) zazas321 1 3,028 Oct-13-2020, 05:58 AM
Last Post: zazas321

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020