trey-jones / xmrwasp

Web and stratum proxy for Monero miners.
GNU General Public License v3.0
20 stars 7 forks source link

Server config for WS and WSS connections #2

Closed wazowski78 closed 6 years ago

wazowski78 commented 6 years ago

Hi, I am having troubles with the WS and WSS connections, so can you share the nginx server config file? Thanks in advance.

trey-jones commented 6 years ago

You don't need nginx to run the proxy. The websocket connections go directly to the proxy. For now, WS is enabled by default, though for 1.1 the plan is to disable it and require a wsport option. You can check the example app to see how the miner is configured.

The example uses port 8888, and the example configs (JSON here work out of the box for that.

To enable WSS, you need to add 3 options to your config:

# environment example
XMRWASP_WSS=true
XMRWASP_TLSCERT=/path/to/certfile
XMRWASP_TLSKEY=/path/to/keyfile

Or, in the JSON config:

{
    wss: true,
    tlscert: "/path/to/certfile",
    tlskey: "/path/to/keyfile",
    // other required configs
}

The user that is running the proxy also needs to have permission to read the key and cert files.

Of course you do need a webserver configured to serve the script files, and your website, but configuring that is definitely outside the scope of this project. Thanks for checking it out!

wazowski78 commented 6 years ago

Thank you for the info, I will try your tips.