title: How to forward data from a host computer to a Docker container?
body: <p>I am working on a project which uses Docker containers. Docker is installed on a Windows 10 host machine. The aim of the project is to forward the data packets that are received on the host to the docker containers so that the container functions make use of those data packets and in turn forward them to other linked containers. </p>
  
  <p>For eg, consider there are 2 containers(container 1 and container 2) running some arbitrary functions. The following has to be achieved:</p>
  
  <pre><code>   Host(Windows 10)-----&gt;Container 1-------&gt;Container 2-------&gt;Host
  </code></pre>
  
  <p>where ------> represents packet forwarding(after the container functions work on them)</p>
  
  <p>As of now, packets are received using Wireshark in the host which just receives the packet and displays the packet details. How can these received packets forwarded to the Docker containers from the host, and from one container to other? Can it be done using Scapy(host to container)? I know that container networking can be used to link different containers,but can data packets be forwarded between them?</p>
  
  <p>Also, by any chance could python or java socket programming be used in the host and inside the containers in any of the context above? Could libraries such as libpcap be used for this purpose?</p>