
// httpClient returns a Client instance for the given URL endpoint
var httpClient = function(endpoint) {
    var httpTransport = function(req, callback) {
        var reqJson = JSON_stringify(req);
        var options = {
            url: endpoint,
            method: "POST",
            headers: {
                "Content-Type": "application/json"
            },
            body: reqJson
        };
        request(options, function(error, response, body) {
            callback(parseResponse(req, error, body));
        });
    };

    return new Client(httpTransport);
};

// Export blessed functions to the package
exports.httpClient = httpClient;
exports.Client = Client;
exports.Server = Server;
exports.JSON_stringify = JSON_stringify;

@@ -573,16 +573,815 @@
 t);%0A%7D;%0A%0A
+// inprocClient returns a Client instance that calls the given Server%0A// directly in process.  This is useful in cases where you develop%0A// separate barrister components as separate packages, but wind up %0A// combining them into a single program at runtime.  It is also useful%0A// for unit testing barrister server implementations because your%0A// tests can consume the service as a Barrister client, which will %0A// perform all the type checks on requests/response values.  This will%0A// catch many problems automatically that you'd normally have to write%0A// assertions for (e.g. function returned an int, but you expected a bool)%0Avar inprocClient = function(server) %7B%0A    var transport = function(req, callback) %7B%0A        server.handle(%7B%7D, req, callback);%0A    %7D;%0A%0A    return new Client(transport);%0A%7D;%0A%0A
 // Expor
@@ -1440,32 +1440,69 @@
 t = httpClient;%0A
+exports.inprocClient = inprocClient;%0A
 exports.Client =

add inprocClient to node.js client