diff options
Diffstat (limited to 'src/spdy2http/proxy.c')
-rw-r--r-- | src/spdy2http/proxy.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/spdy2http/proxy.c b/src/spdy2http/proxy.c index f1513680..018896ee 100644 --- a/src/spdy2http/proxy.c +++ b/src/spdy2http/proxy.c | |||
@@ -20,6 +20,10 @@ | |||
20 | * @file proxy.c | 20 | * @file proxy.c |
21 | * @brief Translates incoming SPDY requests to http server on localhost. | 21 | * @brief Translates incoming SPDY requests to http server on localhost. |
22 | * Uses libcurl. | 22 | * Uses libcurl. |
23 | * BUGS: | ||
24 | * Now the proxy works only when the HTTP server issues | ||
25 | * "Content-Length" header. Will brake on chunhed response. | ||
26 | * No error handling for curl requests. | ||
23 | * @author Andrey Uzunov | 27 | * @author Andrey Uzunov |
24 | */ | 28 | */ |
25 | 29 | ||
@@ -422,7 +426,12 @@ standard_request_handler(void *cls, | |||
422 | abort(); | 426 | abort(); |
423 | } | 427 | } |
424 | 428 | ||
425 | if(-1 == asprintf(&url,"%s%s%s","http://", http_host, path)) | 429 | if(0 == strcmp(http_host, "any")) |
430 | ret = asprintf(&url,"%s%s%s","http://", host, path); | ||
431 | else | ||
432 | ret = asprintf(&url,"%s%s%s","http://", http_host, path); | ||
433 | |||
434 | if(-1 == ret) | ||
426 | { | 435 | { |
427 | PRINT_INFO("No memory"); | 436 | PRINT_INFO("No memory"); |
428 | abort(); | 437 | abort(); |
@@ -489,7 +498,10 @@ main (int argc, char *const *argv) | |||
489 | 498 | ||
490 | if(argc != 6) | 499 | if(argc != 6) |
491 | { | 500 | { |
492 | printf("Usage: %s cert-file key-file host port http/1.0(yes/no)\n", argv[0]); | 501 | printf("Usage: %s cert-file key-file host port http/1.0(yes/no)\n\ |
502 | \n\ | ||
503 | Example for forward proxy (':host' header is used to know which HTTP server to connect):\n\ | ||
504 | %s cert.pem key.pem any 8080 no\n", argv[0], argv[0]); | ||
493 | return 1; | 505 | return 1; |
494 | } | 506 | } |
495 | 507 | ||