Skip to content
This repository has been archived by the owner on Sep 24, 2019. It is now read-only.

Error with WSS in JavaConsole #65

Closed
1 of 3 tasks
wazowski78 opened this issue Feb 4, 2018 · 8 comments
Closed
1 of 3 tasks

Error with WSS in JavaConsole #65

wazowski78 opened this issue Feb 4, 2018 · 8 comments

Comments

@wazowski78
Copy link

Hi,
I am getting this error in JavaConsole:

WebSocket connection to 'wss://iwazowski.me/xmr/api' failed: Unexpected response code: 404

Any tip?

Check list

  • Ask for HELP.

  • Report a BUG.

  • Already check README.md but unsloved.

OS & Browser

VPS systemOS & Browser info. If background info you can give. overwrite here...

LOG / POC

if some log you have or you can give a POC to review the BUG
overwrite here...

Others

overwrite here...

@evil7
Copy link
Contributor

evil7 commented Feb 5, 2018

look like it have some problem running with sub-path...
way to fix this:
in config.json change a doamain and you will need a new domain resolution.
now you are used iwazowski.me/xmr/ in domain setting, try make it run at a domain root. like xmr.iwazowski.me (add a new resolution first).

@wazowski78
Copy link
Author

Hi, I have changed to root path. But I am still getting this error:

WebSocket connection to 'wss://iwazowski.me/api' failed: Unexpected response code: 404

Should I get the api anywhere else? I am missing this part, any tip?

@wazowski78
Copy link
Author

Another thing... my Nginx server has some ports closed, should I change the 7777 value to an open port :) ?

@evil7
Copy link
Contributor

evil7 commented Feb 6, 2018

I can't visit the https://iwazowski.me/demo.html see the pages, is that setting done right now?

this is my demo-site's config:

{
    "lhost": "127.0.0.1",
    "lport": 7777,
    "domain": "deepool.net",
    "pool": "mine.xmrpool.xyz:3333",
    "addr": "41ynfGBUDbGJYYzz2jgSPG5mHrH......u1LKxioRU",
    "pass": "x",
	"key": "",
	"cert": ""
}

so you can see it's running with deepool.net.

And my nginx conf is: (/etc/nginx/sites-available/deepMiner.conf)

server {
listen 80;
server_name deepool.net;
location / {
proxy_http_version 1.1;
proxy_set_header   Host	$http_host;
proxy_set_header   X-Real-IP $remote_addr;
proxy_set_header   Upgrade $http_upgrade;
proxy_set_header   Connection "upgrade";
proxy_cache_bypass $http_upgrade;
proxy_pass         http://127.0.0.1:7777;
}

    listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/deepool.net/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/deepool.net/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


    if ($scheme != "https") {
        return 301 https://$host$request_uri;
    } # managed by Certbot

}

you can change the 7777 to others because it's just a backend port on 127.0.0.1, but need remember to change this port in nginx conf like codes upside (you can find this /etc/nginx/sites-available/deepMiner.conf are in install.sh)

@wazowski78
Copy link
Author

Thank you vey much! Some .conf changes had solved my issue, now is working like a charm! I am closing the issue. Best regards.

@wazowski78
Copy link
Author

wazowski78 commented Feb 6, 2018

Hi again,
now I am having problems trying to include php to the config file. Can you give me any tip :) Thanks a lot.

This is my deepMiner.conf file:

server {
listen 80;
server_name mydomain.com;
location / {
proxy_http_version 1.1;
proxy_set_header   Host	$http_host;
proxy_set_header   X-Real-IP $remote_addr;
proxy_set_header   Upgrade $http_upgrade;
proxy_set_header   Connection "upgrade";
proxy_cache_bypass $http_upgrade;
proxy_pass         http://127.0.0.1:7777;
}

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    if ($scheme != "https") {
        return 301 https://$host$request_uri;
    } # managed by Certbot
}

@wazowski78 wazowski78 reopened this Feb 6, 2018
@wazowski78
Copy link
Author

Well I am answering my own question:

server {
  listen 80;
  server_name mydomain.com;
  root   /srv/deepMiner/web;
  index  index.html index.php;
  location / {
    proxy_http_version 1.1;
    proxy_set_header   Host	$http_host;
    proxy_set_header   X-Real-IP $remote_addr;
    proxy_set_header   Upgrade $http_upgrade;
    proxy_set_header   Connection "upgrade";
    proxy_cache_bypass $http_upgrade;
    proxy_pass         http://127.0.0.1:8888;
  }
  location ~ \.php$ {
          include snippets/fastcgi-php.conf;
          include fastcgi_params;
          fastcgi_pass unix:/run/php/php7.0-fpm.sock;
          fastcgi_param SCRIPT_FILENAME /srv/deepMiner/web$fastcgi_script_name;
  }
  listen 443 ssl; # managed by Certbot
  ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem;
  include /etc/letsencrypt/options-ssl-nginx.conf;
  ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
  if ($scheme != "https") {
    return 301 https://;
  }
}

@evil7
Copy link
Contributor

evil7 commented Feb 7, 2018

XD if you like you can put the deepminer file in webroot too, bcs this fs.readFileSync here is a bug..
if more than 1k connecting, it will open too many file, so you can just keep it only websocket in proxy.
(https://github.com/deepwn/deepMiner/blob/master/server.js#L68 to much fs.readFileSync use here, so...)
will fix at next and you can wait it update. thx for feedback and using.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants