title: Talking to supervisord over xmlrpc
body: <p>I'm trying to talk to <code>supervisor</code> over xmlrpc. Based on <a href="https://github.com/Supervisor/supervisor/blob/master/supervisor/supervisorctl.py" rel="nofollow"><code>supervisorctl</code></a> (especially <a href="https://github.com/Supervisor/supervisor/blob/master/supervisor/options.py#L1512" rel="nofollow">this line</a>), I have the following, which seems like it should work, and indeed it works, in so far as it connects enough to receive an error from the server:</p>
  
  <pre><code>#socketpath is the full path to the socket, which exists
  # None and None are the default username and password in the supervisorctl options
  In [12]: proxy = xmlrpclib.ServerProxy('http://127.0.0.1', transport=supervisor.xmlrpc.SupervisorTransport(None, None, serverurl='unix://'+socketpath))
  
  In [13]: proxy.supervisor.getState()
  </code></pre>
  
  <p>Resulting in this error:</p>
  
  <pre><code>---------------------------------------------------------------------------
  ProtocolError                             Traceback (most recent call last)
  /home/marcintustin/webapps/django/oneclickcosvirt/oneclickcos/&lt;ipython-input-13-646258924bc2&gt; in &lt;module&gt;()
  ----&gt; 1 proxy.supervisor.getState()
  
  /usr/local/lib/python2.7/xmlrpclib.pyc in __call__(self, *args)
     1222         return _Method(self.__send, "%s.%s" % (self.__name, name))
     1223     def __call__(self, *args):
  -&gt; 1224         return self.__send(self.__name, args)
     1225
     1226 ##
  
  
  /usr/local/lib/python2.7/xmlrpclib.pyc in __request(self, methodname, params)
     1576             self.__handler,
     1577             request,
  -&gt; 1578             verbose=self.__verbose
     1579             )
     1580
  
  /home/marcintustin/webapps/django/oneclickcosvirt/lib/python2.7/site-packages/supervisor/xmlrpc.pyc in request(self, host, handler, request_body, verbose)
      469                                           r.status,
      470                                           r.reason,
  --&gt; 471                                           '' )
      472         data = r.read()
      473         p, u = self.getparser()
  
  ProtocolError: &lt;ProtocolError for 127.0.0.1/RPC2: 401 Unauthorized&gt;
  </code></pre>
  
  <p>This is the <code>unix_http_server</code> section of <code>supervisord.conf</code>:</p>
  
  <pre><code>[unix_http_server]
  file=/home/marcintustin/webapps/django/oneclickcosvirt/tmp/supervisor.sock   ; (the path to the socket file)
  ;chmod=0700                 ; socket file mode (default 0700)
  ;chown=nobody:nogroup       ; socket file uid:gid owner
  ;username=user              ; (default is no username (open server))
  ;password=123               ; (default is no password (open server))
  </code></pre>
  
  <p>So, there should be no authentication problems. </p>
  
  <p>It seems like my code is in all material respects identical to the equivalent code from <code>supervisorctl</code>, but <code>supervisorctl</code> actually works. What am I doing wrong?</p>