title: How to create a proxy with scapy
body: <p>I would like to create a proxy using scapy to demonstrate how proxies are used in the real world. What I am trying to accomplish here is both the client sending these packets so I can examine the data being sent and have the proxy in the middle forwarding along these packets. </p>
  
  <p>Ive read online here to create a script to send http requests but I would like it so send all data not just http requests. 
  <a href="https://www.endpoint.com/blog/2015/04/29/raw-packet-manipulation-with-scapy" rel="nofollow noreferrer">https://www.endpoint.com/blog/2015/04/29/raw-packet-manipulation-with-scapy</a></p>
  
  <pre><code>import logging 
  logging.getLogger("scapy").setLevel(1)  
  
  from scapy.all import *  
  
  def make_test(x,y):     
      request = "GET / HTTP/1.1\r\nHost: " + y  + "\r\n"     
      p = IP(dst=x)/TCP()/request     
      out = sr1(p)     
      if out:         
          out.show() 
      if __name__ == "__main__":
      interact(mydict=globals(), mybanner="Scapy HTTP Tester")
  </code></pre>
  
  <p>Also I've seen here on how to forward traffic
  <a href="https://stackoverflow.com/questions/21912854/scapy-forwarding-packages">Scapy forwarding packages</a></p>
  
  <pre><code>#!/usr/bin/python
  
  import sys
  import time
  from scapy.all import sniff, sendp, ARP, Ether
  
  if len(sys.argv) &lt; 3:
      print sys.argv[0] + " &lt;target&gt; &lt;spoof_ip&gt;"
      sys.exit(0)
  
  iface = "wlan1"
  target_ip = sys.argv[1]
  fake_ip = sys.argv[2]
  
  ethernet = Ether()
  arp = ARP(pdst=target_ip, psrc=fake_ip, op="is-at")
  packet = ethernet / arp
  
  while True:
      sendp(packet, iface=iface)
      time.sleep(10)
  </code></pre>
  
  <p>Is there any online guides or any scripts that already outline how to send and forward packets using scapy?</p>