Skip to content

Commit

Permalink
config: enable HTTP/2 (#417)
Browse files Browse the repository at this point in the history
Updates the standard configuration to send requests over HTTP/2 by default.

Note that there are future improvements that should be made here to support negotiating between HTTP/1.1 and HTTP/2, being tracked in #502.

More info on the config change: https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/cds.proto#envoy-api-msg-cluster

Signed-off-by: Michael Rebello <[email protected]>
  • Loading branch information
rebello95 authored Oct 14, 2019
1 parent 03380bc commit 604dbbc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
6 changes: 3 additions & 3 deletions examples/java/hello_world/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
public class MainActivity extends Activity {
private static final String REQUEST_HANDLER_THREAD_NAME = "hello_envoy_java";
private static final String ENVOY_SERVER_HEADER = "server";
private static final String REQUEST_AUTHORITY = "s3.amazonaws.com";
private static final String REQUEST_PATH = "/api.lyft.com/static/demo/hello_world.txt";
private static final String REQUEST_SCHEME = "http";
private static final String REQUEST_AUTHORITY = "api.lyft.com";
private static final String REQUEST_PATH = "/ping";
private static final String REQUEST_SCHEME = "https";

private Envoy envoy;
private RecyclerView recyclerView;
Expand Down
6 changes: 3 additions & 3 deletions examples/kotlin/hello_world/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import java.util.concurrent.atomic.AtomicInteger

private const val REQUEST_HANDLER_THREAD_NAME = "hello_envoy_kt"
private const val ENVOY_SERVER_HEADER = "server"
private const val REQUEST_AUTHORITY = "s3.amazonaws.com"
private const val REQUEST_PATH = "/api.lyft.com/static/demo/hello_world.txt"
private const val REQUEST_SCHEME = "http"
private const val REQUEST_AUTHORITY = "api.lyft.com"
private const val REQUEST_PATH = "/ping"
private const val REQUEST_SCHEME = "https"

class MainActivity : Activity() {
private val thread = HandlerThread(REQUEST_HANDLER_THREAD_NAME)
Expand Down
6 changes: 3 additions & 3 deletions examples/objective-c/hello_world/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#pragma mark - Constants

NSString *_CELL_ID = @"cell-id";
NSString *_REQUEST_AUTHORITY = @"s3.amazonaws.com";
NSString *_REQUEST_PATH = @"/api.lyft.com/static/demo/hello_world.txt";
NSString *_REQUEST_SCHEME = @"http";
NSString *_REQUEST_AUTHORITY = @"api.lyft.com";
NSString *_REQUEST_PATH = @"/ping";
NSString *_REQUEST_SCHEME = @"https";

#pragma mark - ViewController

Expand Down
6 changes: 3 additions & 3 deletions examples/swift/hello_world/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import Envoy
import UIKit

private let kCellID = "cell-id"
private let kRequestAuthority = "s3.amazonaws.com"
private let kRequestPath = "/api.lyft.com/static/demo/hello_world.txt"
private let kRequestScheme = "http"
private let kRequestAuthority = "api.lyft.com"
private let kRequestPath = "/ping"
private let kRequestScheme = "https"

final class ViewController: UITableViewController {
private var requestCount = 0
Expand Down
3 changes: 3 additions & 0 deletions library/common/config_template.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const char* config_template = R"(
connect_timeout: {{ connect_timeout_seconds }}s
dns_refresh_rate: {{ dns_refresh_rate_seconds }}s
dns_lookup_family: V4_ONLY
http2_protocol_options: {}
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: base
Expand All @@ -32,6 +33,7 @@ R"(
connect_timeout: {{ connect_timeout_seconds }}s
dns_refresh_rate: {{ dns_refresh_rate_seconds }}s
dns_lookup_family: V4_ONLY
http2_protocol_options: {}
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: base_wlan
Expand All @@ -42,6 +44,7 @@ R"(
connect_timeout: {{ connect_timeout_seconds }}s
dns_refresh_rate: {{ dns_refresh_rate_seconds }}s
dns_lookup_family: V4_ONLY
http2_protocol_options: {}
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: base_wwan
Expand Down

0 comments on commit 604dbbc

Please sign in to comment.