titaniumnetwork-dev / Ultraviolet-App

Example application of Ultraviolet which can be deployed in production.
https://docs.titaniumnetwork.org/proxies/ultraviolet
MIT License
253 stars 4.02k forks source link

ipaddr: adress has neither ipv6 or ipv4 format #51

Closed chronosirius closed 9 months ago

chronosirius commented 1 year ago

Issue tracker is ONLY used for reporting bugs. New features should be discussed on our Discord server.

Expected Behavior

It should load the page

Current Behavior

(I modified the source code - the address being passed is {"address":"172.217.12.100","family":4},{"address":"2607:f8b0:4005:810::2004","family":6})

It doesn't load the page but it gives TypeError: failed to fetch in the textarea and

Error: ipaddr: the address has neither IPv6 nor IPv4 format [{"address":"172.217.12.100","family":4},{"address":"2607:f8b0:4005:810::2004","family":6}]
    at ipaddr.parse (/home/chronos/Ultraviolet-App/node_modules/@tomphttp/bare-server-node/node_modules/ipaddr.js/lib/ipaddr.js:929:19)
    at GetAddrInfoReqWrap.callback (/home/chronos/Ultraviolet-App/node_modules/@tomphttp/bare-server-node/dist/createServer.js:35:50)
    at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:131:8)

Node.js v20.1.0

I'm running in WSL.

Possible Solution

Steps to Reproduce

  1. npm install the tgz
  2. do npm start
  3. try to use the proxy
  4. error

Context (Environment)

I'm running in WSL after installing tgz

Detailed Description

Possible Implementation

chronosirius commented 1 year ago

Also when I deployed this repo on koyeb directly after forking and using the manual link I got "SyntaxError: Unexpected token 'u', "upstream c"... is not valid JSON" which I would try to figure out if I didn't have a typeerror: failed to fetch

AldenIsMe commented 1 year ago

Right, so I've worked out a temporary fix. Not sure if it breaks anything, but it seems to work for now. The latest version of tomphttp doesnt work. So I uninstalled by removing the "./node_modules/@tomphttp" then running the following command: npm i @tomphttp/bare-server-node@1.2.2

This downgrades tomphttp to version 1.2.2, whereas the latest version 1.2.5 has the ipv4/ipv6 parsing error.

e9x commented 9 months ago

upgrade bare server