How do you handle CORS with TypeScript based Server #4327
Unanswered
radiantone
asked this question in
General
Replies: 1 comment
-
Hi! You can use the exact same set of options with TypeScript: import { createServer } from "http";
import { Server } from "socket.io";
const httpServer = createServer();
const io = new Server(httpServer, {
cors: {
origin: "https://example.com"
}
}); Reference: https://socket.io/docs/v4/handling-cors/ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I saw the docs for how to handle CORS in socket.io server, but it doesn't show how to do this for typescript.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions