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

Route requests through local proxy with CORS #95

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/master' into cors-patch
  • Loading branch information
u8sand committed Oct 1, 2021
commit 28957994c04d4102fb84330f2982545da1daf8ba
8 changes: 3 additions & 5 deletions src/preview/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class PreviewServer {
});

this.server = http.createServer(app);
this.io = socketio(this.server);
this.io = new socketio.Server(this.server);

app.set("host", this.currentHost);
app.set("port", this.currentPort);
Expand All @@ -95,7 +95,7 @@ export class PreviewServer {

private startServer(port) {
this.currentPort = port;
this.server.listen(this.currentPort, this.currentHost , () => {
this.server.listen(this.currentPort, this.currentHost, () => {
this.serverRunning = true;
});
}
Expand All @@ -108,9 +108,7 @@ export class PreviewServer {
{} as any
);
this.io && this.io.to(fileHash).emit("TEXT_UPDATE", content);
} catch (err) {

}
} catch (err) {}
}

getUrl(fileHash: string): string {
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.