No Pusher method/options to add Http headers for web-socket connection establishment

Abierto
#273 0 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
42/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
java
Área
networking

Línea de trabajo

Start in src/main/java/com/pusher/client/connection/websocket/WebSocketClientWrapper.java, where the superclass constructor call is made, and in PusherOptions, which has no way to set headers today. The issue proposes a constructor that accepts a header map and forwards it to the superclass, plus a PusherOptions setter that passes the map down the chain. Done means an origin header set through PusherOptions reaches the websocket handshake. The issue has no comments or linked pull request, so check with maintainers about the API shape before writing code.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

feature-request
What is the issue?

I need to send "origin" header to the server while I establish connection to it. But I couldn’t find any method or pusher options to do so. And the httpAuthorizer only sends headers when a private subscription is performed. As I investigated the Webscoket implementation for this library, I see that there is a WebsocketClient Constructor which takes in httpHeaders as an optional parameter which can solve my issue.

Any improvements you suggest

An additional constructor can be added to WebSocketClientWrapper (which extends the WebsocketClient) which takes a map of httpHeaders as a parameter and then update the super call to send in the httpHeaders.
With this change, a new PusherOptions method can be added which can take httpHeaders as a parameter and supply it up the chain.


CC @pusher/mobile

Lenguaje dominante
Java
Estrellas
315
Forks
140
Merge medio
10 d 14 h
PR fusionados (30 d)
5

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pusher/pusher-websocket-java

Todos los issues de pusher/pusher-websocket-java

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.