Skip to content

Allow different paths for http and ws #4719

@sunshineo

Description

@sunshineo

We are using Azure API management service and it has this limitation:
We have to create 2 separated API for http and ws protocol, and in 2 separate API, we need to have different url suffix. So I end up with

https://api.mycompany.com/chat-service-broadcast/socket.io
wss://api.mycompany.com/chat-service-broadcast-websocket/socket.io

My frontend code:

const PATH = '/chat-service-broadcast/socket.io';

export const socket = io(URL, {
  path: PATH,
  autoConnect: false,
});

And this works on the http call, but then it tries to call wss://api.mycompany.com/chat-service-broadcast/socket.io and fail

Is it very difficult to allow different path? Is there a way I can intercept the websocket call and modify the url before it goes out?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions