Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decompose Client and Transport #422

Open
tshemsedinov opened this issue Jun 27, 2023 · 1 comment
Open

Decompose Client and Transport #422

tshemsedinov opened this issue Jun 27, 2023 · 1 comment

Comments

@tshemsedinov
Copy link
Member

Decompose Client and Transport for browser and server-client implementations

@zpwebbear
Copy link

Hello @tshemsedinov ! I want to clarify scope of work and will try to rephrase your task with my own words. Please approve or deny mu suggestions.

About Transport. Currently it's bound to EventEmitter and definitely can be used only in the server environment.

class Transport extends EventEmitter {
  constructor(server, req) {
    super();
    this.server = server;
    this.req = req;
    this.ip = req.socket.remoteAddress;
  }
/*...*/
}

And then HttpTransport WsTransport both extends Transport. From this point of view it seems that we want to have BrowserHttpTransport, ServetHttpTransport, and so on, at the end of the refactoring. BrowserHttpTransport will be based on the browser fetch and ServerHttpTransport will be still based on the EventEmitter.

Is the vector of my thoughts correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants