Ultraviolet-Node-Archive icon indicating copy to clipboard operation
Ultraviolet-Node-Archive copied to clipboard

Able to run on my personal computer but not on VPS

Open Falcn8 opened this issue 3 years ago • 15 comments

I was running this on my personal computer (MacBook) and it successfully runned and was able to search and visit websites, but when I deployed it on my VPS (Ubuntu 18.04), I couldn't search up things or visit websites using the proxy.

Expected Behavior

Able to search things and visit websites with the proxy.

Current Behavior

Does not redirect me to a proxy search page/website.

Possible Solution

I don't know

Steps to Reproduce

  1. Run UltraViolet on Ubuntu 18.04 with NPM version 8.6.0 and node version 14.17.1
  2. Access the hosted website from a different network
  3. Search something up

Context (Environment)

I'm trying to be able to use the proxy

Falcn8 avatar Apr 11 '22 04:04 Falcn8

Can you open dev tools(in your browser on the page) and look in the console for any errors when clicking the enter button to go to the specified website you want to proxy.

jackchristel avatar Apr 18 '22 23:04 jackchristel

Can you open dev tools(in your browser on the page) and look in the console for any errors when clicking the enter button to go to the specified website you want to proxy.

This is what I got image

Failed to load resource: the server responded with a status of 404 (Not Found)
index.js:6 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'register')
    at HTMLFormElement.<anonymous> (index.js:6:36)
new_rightclick.js:87 Uncaught TypeError: event.cancelBubble is not a function
    at HTMLDocument.bringBackDefault (new_rightclick.js:87:31)

Falcn8 avatar Apr 19 '22 04:04 Falcn8

Service workers can only be registered when using https or on localhost for some reason not really sure how they work, but they do need https. So what you can do is if you don't have a domain I'd use freenom as they are a free domaon provider to an extent, and then point the nameservers to cloudflare, make an A record with the @ name and in the content field put the IP of your vps, and make sure the little cloudflare proxy icon is enabled, that should fix it.

jackchristel avatar Apr 19 '22 04:04 jackchristel

How would I set a specific port (8080) to the website name with Node.js though?

Falcn8 avatar Apr 19 '22 04:04 Falcn8

You can use nginx which is a webserver.

jackchristel avatar Apr 19 '22 04:04 jackchristel

You pass the proxy to nginx, which then listens on port 80 and when visited sends requests to nodejs

jackchristel avatar Apr 19 '22 04:04 jackchristel

How would I set up Ultraviolet/Node.js with Nginx though?

Falcn8 avatar Apr 19 '22 04:04 Falcn8

I've tried that before, but it only proxies the main / page not the /service/... page

Falcn8 avatar Apr 19 '22 04:04 Falcn8

Are you familiar with nginx?

jackchristel avatar Apr 19 '22 04:04 jackchristel

No, I only know a little.

Falcn8 avatar Apr 19 '22 04:04 Falcn8

So in the config, the location would be / and then you'd put a proxy_pass in there

jackchristel avatar Apr 19 '22 04:04 jackchristel

I can assist you tomorrow some more. Sorry.

jackchristel avatar Apr 19 '22 05:04 jackchristel

Ok, thanks

Falcn8 avatar Apr 19 '22 05:04 Falcn8

I have the same problem, I can run it on localhost, 127..0.01 but not my local ip 192.168.1.103, I tried to tweak index.mjs to use https but didn't work. can you give me a link to documentation for using nginx?

draccurate avatar Jun 16 '22 15:06 draccurate

The link to the documentation for proxy_pass is https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/

Falcn8 avatar Jun 16 '22 16:06 Falcn8