Closed hunteriii closed 1 month ago
You can make your own proxy for that, just create a cdn and make those redirects yourself. Lets take localhost:5555 as cdn, when localhost:5555/connect.json is called send connec you have. When localhost:5555/webview.resource is called redirect to page that have file ready to download. And here we go there is your enchantment.
@Iamproplayer7 Thank you, but I test this already on Nginx.
The below config works on browser, but doesn't work on alt:V
.
# server.toml
useCdn = true
cdnUrl = '127.0.0.1:81'
# nginx.conf
server {
listen 81;
location / {
root html;
index index.html;
}
location /webview.resource {
return 301 "https://www.dropbox.com/scl/fi/123/webview.resource?dl=1";
}
}
@hunteriii It seems you need include ?rlkey=** in the link.
My example how i made it work:
const express = require('express');
const app = express()
app.listen(3333);
app.get('/', (req, res) => {
return res.send('works');
});
app.get('/connect.json', (req, res) => {
console.log('Fetch connect.json?')
return res.json({
"files":[
{"hash":"884087420585f320","name":"testresource","size":146,"type":"js"},
],
"host":"127.0.0.1",
"mtu":1392,
"port":7788
});
});
app.get('/testresource.resource', (req, res) => {
console.log('Download file?');
return res.redirect('https://www.dropbox.com/scl/fi/5grzjbltysdmsaojbr1l3/testresource.resource?rlkey=9s3gb4pjbzctbaejd9pwfbzor&dl=1')
})
And thats works and it should work with nginx redirect too. (removing ?rlkey from the url does not work anymore)
Image from test with clean cache when resource forced to download:
I had a problem with Windows Firewall. https://github.com/altmp/altv-issues/issues/2285#issuecomment-2139675147 works perfectly. Thank you.
Description of the problem
After packing the resources with
altv.exe --host 127.0.0.1 --port 7788 --justpack
, we need to add an extralink
property toconnect.json
in order to download the resource from file sharing services likeDropbox
.Take a look at
Additional context
.Desired solution for the problem
For example,
wget
package are able to follow redirects. Follow redirects is very important.Lets imagine we specify
https://db.com/webview.resource
inlink
property. Ifdb.com
redirect us to other domain(db_asset.com)
, we have to follow that.If
link
propery doesn't exist, download the resource from"host": "127.0.0.1"
. Iflink
property exist, download the resource from the specified link.Alternatives you considered
No response
Additional context