Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URIError: Unable to parse 'address' to 'URL' class. #1

Closed
gvmii opened this issue Jan 22, 2024 · 1 comment
Closed

URIError: Unable to parse 'address' to 'URL' class. #1

gvmii opened this issue Jan 22, 2024 · 1 comment

Comments

@gvmii
Copy link

gvmii commented Jan 22, 2024

PS D:\Usuario\Documents\Programming\Misc stuff\discord-ipc-proxy> npm start

> discord-ipc-proxy@1.0.0-rc1 start
> tsc && node dist/index.js

{"evt":"listening","transport":"ws","receiver":"both","port":6463,"timestamp":[886,493887800]}
D:\Ixogamer\Documents\Programming\Misc stuff\discord-ipc-proxy\dist\index.js:41
            throw new URIError("Unable to parse 'address' to 'URL' class.");
                  ^

URIError: Unable to parse 'address' to 'URL' class.
    at D:\Ixogamer\Documents\Programming\Misc stuff\discord-ipc-proxy\dist\index.js:41:19
    at getServer (D:\Ixogamer\Documents\Programming\Misc stuff\discord-ipc-proxy\dist\index.js:43:7)
    at D:\Ixogamer\Documents\Programming\Misc stuff\discord-ipc-proxy\dist\index.js:67:24
    at new Promise (<anonymous>)
    at D:\Ixogamer\Documents\Programming\Misc stuff\discord-ipc-proxy\dist\index.js:66:27
    at tryUntil (D:\Ixogamer\Documents\Programming\Misc stuff\discord-ipc-proxy\dist\index.js:20:23)
    at tryUntil (D:\Ixogamer\Documents\Programming\Misc stuff\discord-ipc-proxy\dist\index.js:24:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async tryUntil (D:\Ixogamer\Documents\Programming\Misc stuff\discord-ipc-proxy\dist\index.js:24:20)
    at async tryUntil (D:\Ixogamer\Documents\Programming\Misc stuff\discord-ipc-proxy\dist\index.js:24:20)

Node.js v18.17.0
PS D:\Usuario\Documents\Programming\Misc stuff\discord-ipc-proxy>
@SpacingBat3
Copy link
Owner

Oh, I think it might be because of duplicate : in path in case of Windows (because of drive letter), I guess I might try to encode it to Unix-alike path, with /a/ meaning an A: drive, so it will work properly when placed in URL class.

I have to admit, I haven't tested how this kind of proxy works on Windows.

SpacingBat3 added a commit that referenced this issue Jan 27, 2024
• Fix running the proxy on Windows (#1), refactor `getServer()`.
• Refactor code so instead of `isJSON()` it uses `try...catch` directly,
  avoiding unnecessary calls to `JSON.parse()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants