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
Atom-shell and socket.io #1141
Comments
You can't pass the socket itself, only the data that comes through the socket, via the |
But my issue is that I only open windows when the socket receive a message, so I can't really do them in a window — On Sat, Feb 14, 2015 at 7:24 PM, Paul Betts notifications@github.com
|
&
You could use a hidden window to open the socket, this way it would already be in the renderer process (and easier to debug).
👍 |
What is the advantage of moving the socket logic from the main.js to the renderer process? They still do the same thing (beyond debugging purposes I mean). I don't have really clear how you would solve using the socket connection from the other windows, I guess I will need to use some sort of communication between windows to achieve that |
Can you please describe your use case a little bit? Is it a chat app or something? Why do you open a new window per received msg and why do you need to pass your socket to this window? Edit: Sorry for not answering your questions first. |
Ok, just ignore this one, I just re-read your first comment. io.on('connection', function(socket){
//open new window
//pass socket to new window
}); |
This is what I am trying to ask, thanks for your time |
Could you tell me something about your use case? What are you trying to accomplish with this? |
Overall this is what the app does: I have an app that when someone is talking to me, it opens a chat window. I have a socket.io on a server, this allow people to join a room, |
I still can't come up with something better than what Paul Betts already said. Consider changing the title of this issue to something with "socket.io". |
You can not explicitly pass an object from browser side to renderer side, but you can make use of But you must notice that |
I start a socket.io connection with my node script main.js (as in the examples). Now, every time I get a message through socket.io I want a new window to open, but how can I pass the
socket
variable that contains the connection?Is there a way to pass variables from the nodejs part to the browser window?
The text was updated successfully, but these errors were encountered: