How to enable external download server?

Hi there,

I’m using FiveM server and resources are getting downloaded from my own server which is using a lot of bandwidth.

Currently it is using 30120 TCP port to download files.

Is there any option use external download server for server assets download.

Similar to Fast Download concept in Counter-Strike servers.

Thanks!

1 Like

Hy,

Fivem also provides such an opportunity:

1 Like

Hi,

I have already done this. But it still fetches from the my original server.

endpoint_add_tcp “0.0.0.0:30673”

Should I remove the above command because it is telling server to fetch from local ip

My default settings:

endpoint_add_tcp “0.0.0.0:30120”
endpoint_add_udp “0.0.0.0:30120”
fileserver_add “.*” “https://yournginxIP/files
adhesive_cdnKey “blabla”

How do I check if clients are download file from this server ?

The nginx web server have a logs dir, and you see the logs of connected and downloads.
But this is described in the description I linked to.

 access_log /dev/stdout asset;
1 Like

I don’t have nginx server. I have created it on apache web server.

I don’t know if it works with apach web server…
I recommend the preparation based on the description because it works.
Regardless, the fact is you can edit where to save logs (google search apache2 logs).

So do I need to setup reverse proxy ?

Like reverse proxy connects to my fivem TCP port and it fetched files from it.

So it is like,

Client requests to => Proxy server => FiveM server => Gets file => caches it => Returns to client

Am I right ?

I think it could be something like that, I don’t know exactly.
I have noticed that there are files that web server can cache and no download again from the fivem server or not always.

So is it working for you ?

I did it with NGINX as described and it works great (takes 60-70% of the load from FIVEM)

Oh. By the way if you do something like this,

Your files are exposed right ? Somebody can just see the file URL and he can download the file .

Cache goes over the web only what the client would get anyway.
Resource files must not be copied!

For example,

Client gets this URL in their console,

https://URL/files/pillbox_hospital/dt1_06_0.ybn?hash=aa0b3aa5652f266eef3bd8b409d67f694f0b7579

They will be able to download these files externally using URL.

Whereas if it gets downloaded from the server without proxy, it stores in some encrypted type.

I just want to make sure that our resources are protected & safe. They shouldn’t be used by someone else

Even so, you only get what you would get anyway, or you get it encrypted here as well.
However, this encryption can be cracked anyway, so only store data that a client can have on a client side!

Are you using another server as a proxy? I am using googld cloud cdn, but when the second player enters, I can’t log in.


How to fix this

There is a work around for this.

You will need to contact one of the player in the server who doesn’t get this error/issue.

Once you find out that player, you will need his “FiveM cache”.

Ask him to do zip of “data” folder and upload it on Google Drive. ( Right click on FiveM and click on Open File Location )

It will be huge in the size like 3-4 Gb.

Delete your “data” folder in FiveM.

Extract data folder in your FiveM.

This should fix the issue.

2 Likes

This is horrible advice. Do not do this ever.

The provided nginx reverse proxy guide works just fine. If you need the same on apache you will need to find a way by yourself.