// Extremely rudimentary URL parsing.
bool parse_url(const string &url, string *protocol, string *user, string *host, string *port, string *path)
{
+ // pipe:foo (or pipe:"foo").
+ if (url.find("pipe:") == 0) {
+ *protocol = "pipe";
+ *path = string(url.begin() + 5, url.end());
+ return true;
+ }
+
size_t split = url.find("://");
if (split == string::npos) {
return false;
if (!parse_url(url, &protocol, &user, &host, &port, &path)) {
return nullptr;
}
- if (protocol == "http") {
+ if (protocol == "http" || protocol == "pipe") {
return new HTTPInput(url, encoding);
}
if (protocol == "udp") {
if (!parse_url(serialized.url(), &protocol, &user, &host, &port, &path)) {
return nullptr;
}
- if (protocol == "http") {
+ if (protocol == "http" || protocol == "pipe") {
return new HTTPInput(serialized);
}
if (protocol == "udp") {