eclipse-vertx / eclipse-vertx/vertx-http-proxy

didn't respect origin server Sec-WebSocket-Extension header

Open
#41 2 comments 0 reactions 1 assignee Claimed by @vietj View on GitHub
bug
Dominant language
Java
Stars
68
Forks
37
PR merge metrics
No merged PRs in 30d

Description

### Questions

Header Sec-WebSocket-Extension is used to negotiate the list of supported extensions between WebSocket client and server.

In Websocket response 101 Switch Protocols, even origin server returns **without** permessage-deflate extension, vertx-http-server proxies websocket message to orign server permessage-deflated.

Undoubly, it will not be functional as orgin server doesn't not support that extension.

### Version

Which version(s) did you encounter this bug ?
4.3.5

### Context

### Do you have a reproducer?

### Steps to reproduce

1. create a new proxy project with below options:
```java
val proxyClient: HttpClient = vertx.createHttpClient()
val proxyOptions = ProxyOptions()
proxyOptions.supportWebSocket = true
val proxy = HttpProxy.reverseProxy(proxyOptions, proxyClient)
proxy.origin(30000, "localhost")

val options = HttpServerOptions()
options.addWebSocketSubProtocol("tty")

vertx
.createHttpServer(options)
.requestHandler(proxy)
.listen(8888) { http ->
if (http.succeeded()) {
startPromise.complete()
println("HTTP server started on port 8888")
} else {
startPromise.fail(http.cause());
}
}
```
2. downlown and execute ttyd
ttyd is an open source project to serve terminal in Web interface.
Download from https://github.com/tsl0922/ttyd/releases and run with command `./ttyd -p 30000 -b /ttyd bash`

4. Open http://localhost:8888/ttyd/

### Extra

As a workaround, I turn off message compression:
```
options.setPerMessageWebSocketCompressionSupported(false)
```

* Anything that can be relevant such as OS version, JVM version

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.