Skip to content

Commit

Permalink
fix: align broker api routes
Browse files Browse the repository at this point in the history
  • Loading branch information
aarlaud committed Jan 31, 2025
1 parent 62306ae commit 367564e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/client/auth/brokerServerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const renewBrokerServerConnection = async (
brokerServerConnectionParams: BrokerServerConnectionParams,
): Promise<HttpResponse> => {
const clientConfig = getConfig();
const apiHostname = clientConfig.API_BASE_URL;
const apiHostname = clientConfig.apiHostname;
const body = {
data: {
type: 'broker_connection',
Expand Down
10 changes: 4 additions & 6 deletions lib/client/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ export const createWebSocket = (
pong: parseInt(localClientOps.config.socketPongTimeout) || 10000,
timeout: parseInt(localClientOps.config.socketConnectTimeout) || 10000,
};
console.log('@@@@@@@@@@@@@@@@@@@@@2');
console.log(clientOpts.accessToken?.authHeader);
if (clientOpts.accessToken && clientOpts.config.UNIVERSAL_BROKER_GA) {
socketSettings['transport'] = {
extraHeaders: {
Expand Down Expand Up @@ -281,10 +279,10 @@ export const createWebSocket = (
});

websocket.on('close', () => {
if (websocket.timeoutHandlerId) {
logger.debug({}, `Clearing ${maskToken(websocket.identifier)} timers.`);
clearTimeout(websocket.timeoutHandlerId);
}
// if (websocket.timeoutHandlerId) {
// logger.debug({}, `Clearing ${maskToken(websocket.identifier)} timers.`);
// clearTimeout(websocket.timeoutHandlerId);
// }
closeHandler(localClientOps, identifyingMetadata);
});

Expand Down
2 changes: 1 addition & 1 deletion lib/hybrid-sdk/http/downstream-post-stream-to-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class BrokerServerPostResponseHandler {
try {
const backendHostname =
this.#config.universalBrokerEnabled && this.#config.universalBrokerGa
? `${this.#config.apiHostname}/hidden/broker`
? `${this.#config.apiHostname}/hidden/brokers`
: this.#config.brokerServerUrl;
const url = new URL(
`${backendHostname}/response-data/${this.#brokerToken}/${
Expand Down
2 changes: 1 addition & 1 deletion lib/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const main = async (serverOpts: ServerOpts) => {
authRefreshHandler,
);
app.post(
'/hidden/broker/response-data/:brokerToken/:streamingId',
'/hidden/brokers/response-data/:brokerToken/:streamingId',
handlePostResponse,
);

Expand Down

0 comments on commit 367564e

Please sign in to comment.