Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
trinopoty committed Mar 30, 2022
2 parents 4b6d00e + e8a2601 commit 377cc90
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docs/spring-integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Add a class to contain the bulk of engine.io handling code::

private static final String ATTRIBUTE_ENGINEIO_BRIDGE = "engineIo.bridge";
private static final String ATTRIBUTE_ENGINEIO_QUERY = "engineIo.query";
private static final String ATTRIBUTE_ENGINEIO_HEADERS = "engineIo.headers";

private final EngineIoServer mEngineIoServer;

Expand All @@ -48,6 +49,7 @@ Add a class to contain the bulk of engine.io handling code::
@Override
public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) {
attributes.put(ATTRIBUTE_ENGINEIO_QUERY, request.getURI().getQuery());
attributes.put(ATTRIBUTE_ENGINEIO_HEADERS, request.getHeaders());
return true;
}

Expand Down Expand Up @@ -91,6 +93,7 @@ Add a class to contain the bulk of engine.io handling code::

private final WebSocketSession mSession;
private final Map<String, String> mQuery;
private final Map<String, List<String>> mHeaders;

EngineIoSpringWebSocket(WebSocketSession session) {
mSession = session;
Expand All @@ -101,6 +104,7 @@ Add a class to contain the bulk of engine.io handling code::
} else {
mQuery = new HashMap<>();
}
this.mHeaders = (Map<String, List<String>>) mSession.getAttributes().get(ATTRIBUTE_ENGINEIO_HEADERS);
}

/* EngineIoWebSocket */
Expand All @@ -110,6 +114,11 @@ Add a class to contain the bulk of engine.io handling code::
return mQuery;
}

@Override
public Map<String, List<String>> getConnectionHeaders() {
return mHeaders;
}

@Override
public void write(String message) throws IOException {
mSession.sendMessage(new TextMessage(message));
Expand Down Expand Up @@ -185,4 +194,4 @@ Or in Java::
}
}

This serves as a gateway for engine.io and is same for all other server that builds on top of engine.io, viz. Socket.io .
This serves as a gateway for engine.io and is same for all other server that builds on top of engine.io, viz. Socket.io .

0 comments on commit 377cc90

Please sign in to comment.