diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java index 914c39aa70..58fc9ab473 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java @@ -516,7 +516,12 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer { } if (spoofHost != null) setEntry(headers, "Host", spoofHost); - setEntry(headers, "Connection", "close"); + + // Force Connection: close, unless websocket + String conn = getEntryOrNull(headers, "Connection"); + if (conn == null || !conn.toLowerCase(Locale.US).contains("upgrade")) + setEntry(headers, "Connection", "close"); + // we keep the enc sent by the browser before clobbering it, since it may have // been x-i2p-gzip String enc = getEntryOrNull(headers, "Accept-Encoding"); @@ -1044,6 +1049,8 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer { name = "User-Agent"; else if ("referer".equals(lcName)) name = "Referer"; + else if ("connection".equals(lcName)) + name = "Connection"; // For incoming, we remove certain headers to prevent spoofing. // For outgoing, we remove certain headers to improve anonymity. diff --git a/history.txt b/history.txt index 6beb960ad7..39080b4ba8 100644 --- a/history.txt +++ b/history.txt @@ -2,6 +2,8 @@ * I2CP: - Remove revocation private key from CreateLeaseset2 message - Use correct key to sign SessionConfig with offline keys + * i2ptunnel: Fix HTTP websockets by passing through + Connection headers containing "upgrade" (ticket #2422) * Streaming: - Support offline signatures (proposal 123) - Don't send FROM in RESET, not required since 0.9.20 diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 4e28a2c8d2..c10128fe62 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 5; + public final static long BUILD = 6; /** for example "-test" */ public final static String EXTRA = "";