title: Command-line connect curl to an integer socket opened by my application using socket()
body: <p>Basically I have an application that has opened a socket.</p>
  
  <p>e.g.</p>
  
  <pre><code>int socket = socket(PF_LOCAL, SOCK_STREAM, 0);
  </code></pre>
  
  <p>Now I want to send an HTTP put request to that socket. I know I should be using libcurl but I just can't get that to work correctly. So I want a way to connect curl to my application.</p>
  
  <p>Maybe something like??</p>
  
  <pre><code>curl -X PUT -d @myXmlFile.xml /var/run/myunixsocket
  </code></pre>
  
  <p>Is there no way besides using libcurl??? I can't get it to work or find an example of it actually writing to a socket rather than a URI.</p>
  
  <p>It should go without saying that an HTTP server is listening on the other end of that socket.</p>