uber-archive / multitransport-jsonrpc

JSON-RPC Client (Node.js & Browser) and Server (Node.js) aim at "natural looking" server and client code.
116 stars 22 forks source link

Using Net.connect with explicit options object forbids use of Unix sockets #48

Closed moll closed 10 years ago

moll commented 10 years ago

Hey,

Please pass port directly to Net.connect so one could use this with Unix sockets by passing in a string or a custom options object with path set.

Cheers

moll commented 10 years ago

To clarify, this affects the client TCP transport. Possibly others too, though I haven't checked.

dfellis commented 10 years ago

Now this is probably because development of this library started way back in the node 0.4 days. Perfectly willing to alter this as only node 0.8 and up are supported, now.

dfellis commented 10 years ago

Wait, that's exactly what the code does. It calls it a "port", but never validates it in any way so you can pass in a path for a FIFO or an already-initialized socket object and it'll Just Work™

moll commented 10 years ago

Yeah, the server fortunately does it so, but as I said in the clarification, the client still passes it as an object. ;)

dfellis commented 10 years ago

Hmm... Fixing this is going to need a backwards-incompatible API change, or a really gnarly overloading mechanism spread over three functions. Let me think about this.

dfellis commented 10 years ago

Just realized that I didn't publish this merged change. Going to publish now.

dfellis commented 10 years ago

Published as 0.4.1 :)