[Twisted-Python] XML-RPC over Unix Sockets?

Hello! I'm trying to build a client / server setup using XML-RPC run over UNIX sockets. Putting together the server part was a breeze, just define an xmlrpc class and have the reactor use it with a listenUNIX() call. Now, since I've been unable to put together a client I don't really know that the server works, but I'm assuming it is. At least it does not generate any run-time errors. Now, on the client on the other hand I've basically copied this example: http://twistedmatrix.com/projects/web/documentation/howto/xmlrpc.html#auto5 but replaced the Proxy connection string with: proxy = Proxy('file:///tmp/my_socket') in the hope that it would just magically work. It did not. Having a look at http://twistedmatrix.com/trac/browser/tags/releases/twisted-8.2.0/twisted/we... I see that the callRemote() method only seem to support connectTCP() and connectSSL(). Should it not also support connectUNIX? Is there any reason it does not? Am I insane? Is XML-RPC over UNIX domain sockets just plain crazy, or is there even some flaw that makes it impossible? Any suggestions are most welcome. Thank you. Kind regards, Kristian. -- Kristian Larsson KLL-RIPE +46 704 910401 kll@spritelink.net _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

On 5 Jul, 10:32 pm, kristian@spritelink.net wrote:
I'm trying to build a client / server setup using XML-RPC run over UNIX sockets.
It may be possible to do, but there are a number of ugly details that you've ignored. For example, when one has an URL like 'http://example.com/my/custom/site/RPC2', it's very clear where the host (network endpoint) is and where the path (thing that you send to that network endpoint to identify the resource) is. But if you have 'file:///tmp/example_com/my/custom/site/RPC2' it's not at a all clear which of those things is a directory, which is a socket, and which is a path for the HTTP part which isn't present in the filesystem at all. This would certainly require some reworking of Twisted's HTTP internals and the creation of a new URL scheme so that those things could be identified. I wouldn't say that these changes would be rejected out of hand, necessarily, but you would have to have pretty good test coverage, good documentation and an explanation of why such a thing would be a better idea than an HTTP server listening only on localhost :). _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

On 5 Jul, 10:32 pm, kristian@spritelink.net wrote:
I'm trying to build a client / server setup using XML-RPC run over UNIX sockets.
It may be possible to do, but there are a number of ugly details that you've ignored. For example, when one has an URL like 'http://example.com/my/custom/site/RPC2', it's very clear where the host (network endpoint) is and where the path (thing that you send to that network endpoint to identify the resource) is. But if you have 'file:///tmp/example_com/my/custom/site/RPC2' it's not at a all clear which of those things is a directory, which is a socket, and which is a path for the HTTP part which isn't present in the filesystem at all. This would certainly require some reworking of Twisted's HTTP internals and the creation of a new URL scheme so that those things could be identified. I wouldn't say that these changes would be rejected out of hand, necessarily, but you would have to have pretty good test coverage, good documentation and an explanation of why such a thing would be a better idea than an HTTP server listening only on localhost :). _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (2)
-
glyph@divmod.com
-
Kristian Larsson