titaniumnetwork-dev / Ultraviolet

A highly sophisticated proxy used for evading internet censorship or accessing websites in a controlled sandbox using the power of service-workers. Works by intercepting HTTP requests with a service worker script that follows the TompHTTP specifications.
https://docs.titaniumnetwork.org/proxies/ultraviolet
GNU Affero General Public License v3.0
565 stars 4.13k forks source link

Discord.com doesn't work and Most sites are broken: #136

Closed not-amplify closed 2 months ago

not-amplify commented 6 months ago

Hey, I'm currently developing a proxy using UV v3 and I just get this when I try to use Discord: image Something I've noticed is it attempts to connect to ws://127.0.0.1:1 and that's the last error message before it fails I've also noticed issues with other sites :/ I'm not sure if it could be my register code but here it is:

function setupTransports() {
  let proxyMode = localforage.getItem('proxyMode') || 'epoxy'
  var bare = localforage.getItem("bare") || location.host + "/bare";
  var wispUrl = (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/wisp/";
  if (proxyMode == "epoxy") {
    BareMux.SetTransport("EpxMod.EpoxyClient", { wisp: wispUrl });
  } else if (proxyMode == "bare") {
    BareMux.SetTransport("BareMod.BareClient", bare);
  } else if (proxyMode == "libcurl") {
    BareMux.SetTransport("CurlMod.LibcurlClient", { wisp: wispUrl, wasm: "/assets/other/libcurl.wasm" });
  } else {
    BareMux.SetTransport("EpxMod.EpoxyClient", { wisp: wispUrl });
  }
}

if ('serviceWorker' in navigator) {
    BareMux.registerRemoteListener(navigator.serviceWorker.controller)
    navigator.serviceWorker.ready.then(async () => {
      setupTransports();
    });
    var proxySetting = localStorage.getItem('proxy') || 'uv';
    let swConfig = {
      'uv': { file: '/proxies/@/sw.js', config: __uv$config },
      'dyn': { file: '/proxies/dynamic/sw.js', config: __dynamic$config }
    };

    let { file: swFile, config: swConfigSettings } = swConfig[proxySetting];

    navigator.serviceWorker.register(swFile, { scope: swConfigSettings.prefix })
      .then((registration) => {
        console.log('ServiceWorker registration successful with scope: ', registration.scope);
        form.addEventListener('submit', async (event) => {
          event.preventDefault();

          let encodedUrl = swConfigSettings.prefix + crypts.encode(search(address.value));
          sessionStorage.setItem("encodedUrl", encodedUrl);
          const browseSetting = localStorage.getItem('browse');
          const browseUrls = {
            "edu": "/edu",
            "tabs": "/tabs",
            "norm": encodedUrl
          };

          const urlToNavigate = browseUrls[browseSetting] || "/edu";
          location.href = urlToNavigate;
        });
      })
      .catch((error) => {
        console.error('ServiceWorker registration failed:', error);
      });
  }
}

Any help would be appreciated

Percslol commented 6 months ago

can you tell me what release of v3 you are using, everything seems to be fine on latest and sites seem to be loading

Percslol commented 6 months ago

also the error you specified seeing is fine, thats just bare-mux's fake websocket

not-amplify commented 6 months ago

can you tell me what release of v3 you are using, everything seems to be fine on latest and sites seem to be loading

Ultraviolet v3.1 with a modification from illusionsTBA’s middleware injection UV.

not-amplify commented 6 months ago

That shouldn’t affect it tho

Percslol commented 6 months ago

could you try a fresh version off of the GitHub releases or npm?

not-amplify commented 6 months ago

could you try a fresh version off of the GitHub releases or npm?

I updated my repo with ur version and its still not working now I'm also having a bare clients issue, siggggggghhhhhhhhhhhhhhh.....................

Bear-a1t commented 6 months ago

There’s a error if ('serviceWorker' in navigator) { BareMux.registerRemoteListener(navigator.serviceWorker.controller) navigator.serviceWorker.ready.then(async () => { setupTransports(); })}; i added a }

not-amplify commented 6 months ago

There’s a error if ('serviceWorker' in navigator) { BareMux.registerRemoteListener(navigator.serviceWorker.controller) navigator.serviceWorker.ready.then(async () => { setupTransports(); })}; i added a }

What the full code so I can see the difference I’m always dumb and confused on 2 hours of sleep

Bear-a1t commented 6 months ago

This was previous if ('serviceWorker' in navigator) { BareMux.registerRemoteListener(navigator.serviceWorker.controller) navigator.serviceWorker.ready.then(async () => { setupTransports(); });

 this is what i did 

 if ('serviceWorker' in navigator) {

BareMux.registerRemoteListener(navigator.serviceWorker.controller) navigator.serviceWorker.ready.then(async () => { setupTransports(); })};

not-amplify commented 6 months ago

Okay

Notplayingallday383 commented 6 months ago

can you tell me what release of v3 you are using, everything seems to be fine on latest and sites seem to be loading

Ultraviolet v3.1 with a modification from illusionsTBA’s middleware injection UV.

Illusions version of UV has not been updated to UV 3x. If your using it that's probably why. If you flat out modified UV you probably just messed up

not-amplify commented 6 months ago

can you tell me what release of v3 you are using, everything seems to be fine on latest and sites seem to be loading

Ultraviolet v3.1 with a modification from illusionsTBA’s middleware injection UV.

Illusions version of UV has not been updated to UV 3x. If your using it that's probably why. If you flat out modified UV you probably just messed up

I directly modified UV. I can confirm that it is not me because UV v3 without the modifications doesn’t work still

Percslol commented 6 months ago

can you tell me what release of v3 you are using, everything seems to be fine on latest and sites seem to be loading

Ultraviolet v3.1 with a modification from illusionsTBA’s middleware injection UV.

Illusions version of UV has not been updated to UV 3x. If your using it that's probably why. If you flat out modified UV you probably just messed up

I directly modified UV. I can confirm that it is not me because UV v3 without the modifications doesn’t work still

UV v3 without modifications seems to work on the public proxy instances, could you send me the link to the repo where v3 is trying to be implemented if thats possible

not-amplify commented 6 months ago

can you tell me what release of v3 you are using, everything seems to be fine on latest and sites seem to be loading

Ultraviolet v3.1 with a modification from illusionsTBA’s middleware injection UV.

Illusions version of UV has not been updated to UV 3x. If your using it that's probably why. If you flat out modified UV you probably just messed up

I directly modified UV. I can confirm that it is not me because UV v3 without the modifications doesn’t work still

UV v3 without modifications seems to work on the public proxy instances, could you send me the link to the repo where v3 is trying to be implemented if thats possible

https://github.com/NightProxy/Night-UV I gotta redo the mods to update the repo cause I also modified the build

catfoolyou commented 2 months ago

Discord works perfectly fine for me, using a Gitpod deployment

not-amplify commented 2 months ago

Discord works perfectly fine for me, using a Gitpod deployment

do you not see this issue is dead ;-;