score:0
you need to configure cors even on localhost in case the web application and your server are not served from the same port
revised socket.io initialization would be
const io = socketio(server, {
cors: {
origin: "http://localhost:3000",
methods: ["get", "post"] // add the methods you want to allow
}
});
Source: stackoverflow.com
Related Query
- socket connect event inside useEffect does not work when component is created but works after refreshing the page in React
- React Redux connect API does not inject dispatch property
- redux and react connect does not work?
- Socket IO - server not connecting with my react client
- React component and Apollo Client does not work "in real time"
- React component does not call connect redux function
- React client socket not connecting with server socket
- How to connect mySQL data base (on hosting which does not support Node.js) to React application (JS)?
- Why does calling react setState method not mutate the state immediately?
- forEach() in React JSX does not output any HTML
- Property does not exist on type 'DetailedHTMLProps, HTMLDivElement>' with React 16
- Why does React Native not offer a justify-self
- Attempted import error: 'uuid' does not contain a default export (imported as 'uuid') In React
- React router 4 does not update view on link, but does on refresh
- React-redux store updates but React does not
- React wrapper: React does not recognize the `staticContext` prop on a DOM element
- How to solve Warning: React does not recognize the X prop on a DOM element
- onFocus and onBlur does not render in react
- Why does my React Component Export not work?
- Maxlength does not work React Js
- React css transition does not work correctly
- React - useState - why setTimeout function does not have latest state value?
- React 18: Hydration failed because the initial UI does not match what was rendered on the server
- React Native - why padding does not work?
- React Native does not support development on Windows (yet)?
- Webpack 4 and react loadable does not seems to create correct chunk for server side rendering
- React Native react-native-maps Mapview does not show up
- React Native on Ipad - Error - could not connect to development server
- React Context api - Consumer Does Not re-render after context changed
- React does not recognize the `computedMatch` prop on a DOM element.
More Query from same tag
- How to track which list item was clicked in React?
- A weird error occurring when trying to implement useEffect
- Redux adds duplicate array item when loaded from state
- Google Cloud Bucket and ReactJS app Access
- Unhandled Rejection: default.get is not a function
- How to use react-icons with select-option form element?
- Pass data across Screens
- TinyMCE - text direction changes automatically to Right-to-left in React Js
- Insufficient Permission: Request had insufficient authentication scopes in google directory API when logging through admin
- How to templating json using Reactjs
- How to handle Audio playing in React & Redux
- What is the best way to use a list as a key in JavaScript?
- Can't get data from firebase
- Redirecting automatically to another site in javascript
- How to display json data using react jsx with sweet alert 2?
- Render component in Drawer with Material-ui Lists
- How to add psuedo element :after using REACT
- What's the purpose of using classes in React?
- Change file object to normal object in React
- How to display time with momentjs in react
- Each child in a list should have a unique "key" prop. Even though i am giving a key and its a unique one
- React loop through map and display components
- error too many re-renders. react limits the number of renders to prevent an infinite loop
- Webcam light doesnt turn off after setting the video constraint to false in webRtc
- How can it possible to share different state on different multiple Components in React-Redux
- Unable to access props passed to a child component
- Render different react-components depending on property-value
- React Redux export default with 2 functions
- Variable not iterating
- static class function access issue withRouter typescript react