Comments (10)
are you creating an https server and passing it to the proxy like this? https://github.com/cazala/coin-hive-stratum#how-can-i-make-my-proxy-work-with-wss
from coin-hive-stratum.
I did not do that. How do I do that? Do I add that to my javascript or is this done elsewhere? By the way, I am using apache, will this conflict with apache?
from coin-hive-stratum.
save this as your proxy.js
// Create your proxy
const createProxy = require("coin-hive-stratum");
const proxy = createProxy({
host: "la01.supportxmr.com",
port: 3333
});
// Create an HTTPS server
const fs = require("fs");
const server = require("https").createServer({
key: fs.readFileSync("./server.key"),
cert: fs.readFileSync("./server.crt")
});
server.listen(8892);
// Pass your HTTPS server to the proxy
proxy.listen({
server: server
});
and just run it like node proxy
, you should be able to access it from wss://localhost:8892
.
you will need those server.key
and server.crt
certificates in order to work. you can generate self-signed certificates by running this:
openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt
but those certificates won't be trusted by your browser, so you will get an alert, so you will have to add them to your trusted certificates manually
I have no idea about Apache tho, it might need some extra configuration.
from coin-hive-stratum.
i got it to run within http and just tried this for https.
i did not configure https for my server since i want to keep flexible ssl on cloudflare.
i copied a valid key and crt in the same folder my new proxy.js is inside.
Now i get a "Error: Cannot find module 'coin-hive-stratum'
" error when i try to run it with node proxy (also tried as root).
can you help me out?
from coin-hive-stratum.
from coin-hive-stratum.
do
npm init --yes && npm i --save coin-hive-stratum
in the same dir where you have your proxy.js file
from coin-hive-stratum.
Now i have a new error
"Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
"
Is this below here correct? proxy.js and key,crt and pem file in the same folder.
// Create an HTTPS server
const server = require("https").createServer({
key: "mysite.key",
cert: "mysite.crt"
});
from coin-hive-stratum.
from coin-hive-stratum.
I worked around it:
I disabled ssl for my domain:port in a page rule in cloudflare.
Now it works :)
from coin-hive-stratum.
Nice :D !
there was a line missing in the code from my comment above:
const fs = require("fs");
I just edited the comment and added it to the readme
from coin-hive-stratum.
Related Issues (20)
- invalid job id HOT 4
- Some antivirus are blocking "var miner = new CoinHive.Anonymous" HOT 1
- Can't get connected to Nanopool? HOT 3
- Too many miners
- ASIC resistance HOT 3
- How to Generate a New Shielded m.js File from the Modified coinhive.min.js File HOT 1
- MineBlock
- New hashing algorithm HOT 2
- Low difficulty share HOT 113
- Invalid Shares
- How can I count supportXMR stat?
- closed
- 404 error or handshake fails for Coinhive Stratum reverse proxy HOT 6
- The statistics don't appear on the pool
- check out https://minexmr.stream HOT 2
- No updates, can't use it? HOT 2
- EACCES 0.0.0.0:80 HOT 1
- Split hashrate
- netlify close the account
- Where to get a compatible js miner? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coin-hive-stratum.