Skip to content

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

Open
@lawrenceching

Description

@lawrenceching

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:
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());
        }
      }
  1. 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

  2. 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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions