javascript - How to link an HTTP request with a WebSocket client? -


i'm writing full stack application using react, redux, express , passport. communication between front , ends i'm using websockets instead of ajax requests. i'm trying send redux actions through websockets, dispatch them receive them @ front end. don't know if that's practice or not, made sense me , far it's working nice.

the client authentification managed passport , express, , use external providers facebook or google. when user logs in, request @ server /auth/callback, , redirect user root /.

at point, want send action server client, redux store gets updated user information , react components rendered accordingly.

however, client redirected /, need wait until js code opens websocket connection front end. @ end, want able identify specific connection when opens , send action information fetch req.user.

the problem far don't have relation between websocket client , http request have stored user.

how can link them?


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -