Closed mboperator closed 5 years ago
I'm building a decentralized story telling desktop application using Electron. The Electron app is comprised of a server and a client.
The client is a React app. The server is a node server running Express with Gun middleware.
Package Versions
"express": "~4.16.1" "gun": "^0.2019.726" "electron": "4.0.8" "node": "12.10.0"
When running the server outside of Electron in dev mode, everything works fine:
My Electron app is unable to hit the Gun websocket endpoint when the server is run from within Electron:
Gun
The server is able to start properly inside of Electron. http://localhost:7000 shows my hello world page.
http://localhost:7000
hello world page
This is the Electron server:
This is how I'm spinning up my express server inside of Electron:
production
localhost
file
cors
node-webcrypto-openssl
@peculiar/webcrypto
If anyone has any example of an Express server running Gun inside of Electron that would be a huge help.
Thanks in advanced!
Fixed my own issue. The return value of server.listen needs to be passed into the Gun constructor.
server.listen
Sorry about that! Glad you got it working.
Context
I'm building a decentralized story telling desktop application using Electron. The Electron app is comprised of a server and a client.
The client is a React app. The server is a node server running Express with Gun middleware.
Package Versions
The Problem
When running the server outside of Electron in dev mode, everything works fine:
My Electron app is unable to hit the
Gun
websocket endpoint when the server is run from within Electron:The server is able to start properly inside of Electron.
http://localhost:7000
shows myhello world page
.Relevant Code Snippet
This is the Electron server:
This is how I'm spinning up my express server inside of Electron:
Things I've Tried:
production
, the client app's origin changes fromlocalhost
tofile
so I tried addingcors
. No dice.node-webcrypto-openssl
so I switched gun to use@peculiar/webcrypto
. Still not working.If anyone has any example of an Express server running Gun inside of Electron that would be a huge help.
Thanks in advanced!