Closed matsn0w closed 2 years ago
Strange thing is, txAdmin for example does work with both server addresses...?
That's wierd... It might be the way I'm initializing koa... Mind you, I don't specify a host so it should be listening on all interfaces https://stackoverflow.com/a/33957043/16288660.
Are you requesting these resources yourself or is it through the interface? If its through the interface, could you try accessing the interface through the same interface (so your URL matches the IP being requested). If that works then, it's probably the browser's CORS (https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) policy...
If it's not the browser and you're requesting these manually, let me know how you're requesting them (and the versions of Chromium) and I'll see if I can figure out a repro and fix.
Hey, it's weird indeed ;)
I've tried both requesting the file manually and through the interface, both give the same results! I'm not getting any CORS related warnings in the console.
Can you reproduce this?
Can you reproduce this?
Just had a look now with the latest resource and latest artifact... Cannot reproduce on Firefox (Version 96.0.4664.110 (Official Build) (64-bit)) nor Chrome (Version 96.0.4664.110 (Official Build) (64-bit))
Windows version of curl:
And Edge (Version 96.0.1054.62 (Official build) (64-bit)):
I am still on Windows 10 though and don't have a Windows 11 machine to test on (maybe the OS is fucky with the different addresses even though they're the same thing).
Ps. Sorry for the late response, only spare time I've manage to find 😛
Hey, thanks for your testing. Appreciate your time :)
I'm starting to think that this is indeed a Windows 11 issue... My curl results:
I've also updated my test server to the latest recommended artifact, but with no luck.
Thing is, it's also not working on our server. Both using the direct IP and a 'written' hostname give the same 404 result. Could it be my config?
# live map
set socket_port 30140
set livemap_debug "warn" # "[all]" 'trace', 'debug', 'info', 'warn', 'error', 'fatal', 'off'
set blip_file "server/blips.json"
set livemap_access_control "*"
set livemap_use_nucleus false # Allow livemap to set up a secure reverseProxy using the Nucleus project
add_ace group.admin command.blips allow
BTW, server is on Linux, so if this is the same problem it shouldn't be related to Windows I guess.
Tbh. That looks like it could be a FiveM error message. Do you get a result if you get /players.json or /info.json?
Interesting... This is the other way around 😂
Yeah... So for some reason it looks like FiveM is binding to the socket port on 127.0.0.1 and LiveMap is getting localhost.... Even though localhost should be pointing to 127.0.0.1 (or something I think I know is wrong)... I can maybe get a potential fix up on a new branch for you to try (it'll just be giving koa the 0.0.0.0 interface to listen on).
You don't have FiveM listening on the same port, do you? :joy:
Yeah... So for some reason it looks like FiveM is binding to the socket port on 127.0.0.1 and LiveMap is getting localhost.... Even though localhost should be pointing to 127.0.0.1 (or something I think I know is wrong)... I can maybe get a potential fix up on a new branch for you to try (it'll just be giving koa the 0.0.0.0 interface to listen on).
Ah, yeah if you'd like to do that, please!
You don't have FiveM listening on the same port, do you? 😂
Our server is a little different in many ways 😉
Okay, could you try both branches and see if any fix your issue.
https://github.com/TGRHavoc/live_map/tree/matsn0w/0.0.0.0 https://github.com/TGRHavoc/live_map/tree/matsn0w/127.0.0.1
If they do, I'll merge into master 😄
Woohoo 🙌
The version with 127.0.0.1
is working!
The other one gives me an error on startup, saying Error: listen EADDRINUSE: address already in use 0.0.0.0:30140
^^ first two are on
0.0.0.0
, second two on 127.0.0.1
Perfect. I'll merge as soon as I can.
Curious as to why you're getting conflicting addresses... FiveM shouldn't be listening on that port unless told to...
Curious as to why you're getting conflicting addresses... FiveM shouldn't be listening on that port unless told to...
I absolutely have no clue. Last thing I can think of is Docker running on my machine. Server is also Docker-based.
@TGRHavoc small follow-up; I've updated the resource on our server, but I'm getting this error:
[ c-scripting-core] Creating script environments for live_map
[script:live_map] LiveMap will not use nucleus
[ citizen-server-impl] Started resource live_map
[script:live_map] Error calling system tick function in resource live_map: Error: listen EADDRINUSE: address already in use 127.0.0.1:30140
[script:live_map] stack:
[script:live_map] Error: listen EADDRINUSE: address already in use 127.0.0.1:30140
[script:live_map] at __node_internal_captureLargerStackTrace (node:internal/errors:464:5)
[script:live_map] at __node_internal_uvExceptionWithHostPort (node:internal/errors:563:12)
[script:live_map] at Server.setupListenHandle [as _listen2] (node:net:1319:16)
[script:live_map] at listenInCluster (node:net:1367:12)
[script:live_map] at doListen (node:net:1505:7)
[script:live_map] at processTicksAndRejections (node:internal/process/task_queues:84:21)
[script:live_map] at process.runNextTicks [as _tickCallback] (node:internal/process/task_queues:65:3)
[script:live_map] at onTick (citizen:/scripting/v8/timer.js:222:28)
[script:live_map] at citizen:/scripting/v8/timer.js:265:13
[script:live_map] at Number.__cfx_wrap_5 (citizen:/scripting/v8/main.js:23:12)
[script:live_map] at citizen:/scripting/v8/main.js:29:16
[script:live_map] at citizen:/scripting/v8/timer.js:264:16
Any idea how this is possible?
:thinking: I feel that somehow either FiveM is taking the socket port for itself or, the resource isn't exiting cleanly and removing the handler on that port... Making it in use.
Tested on the server without any other resources enabled, still same issue. I'm contacting my hosting company to see if they can have a look into this.
I don't have this issue locally by the way.
Obviously I must use a different port for the socket than the server. The host is setting up a different one for us, let's see if that works!
Obviously I must use a different port for the socket than the server. The host is setting up a different one for us, let's see if that works!
Did it work with a defirnt one i have the same problem with 30121
Obviously I must use a different port for the socket than the server. The host is setting up a different one for us, let's see if that works!
Did it work with a defirnt one i have the same problem with 30121
Problem seems to be related to the host.
Describe the bug I've found a strange issue when trying to access the
blips.json
file... When requestinglocalhost:30121/blips.json
I get a 200 response, but when requesting127.0.0.1:30121/blips.json
, I receive a 404?LOL, whut?
To Reproduce Steps to reproduce the behavior:
http://localhost:PORT/blips.json
http://127.0.0.1:PORT/blips.json
Desktop (please complete the following information):