Well, I'm trying to handle a HTTP GET request to a website. How can I store the output?
Something like the AJAX request to get a XML, but in my case, JSON
How to do it? Any examples would be useful :)
Yep something as JSON.parse for vc-mp will be fine :D But I think you have to do it yourself :(
Quote from: vito on May 14, 2016, 10:45 AMYep something as JSON.parse for vc-mp will be fine :D But I think you have to do it yourself :(
This is not about JSON.parse, I want to make a GET request to a HTTP server.
You need proxy like a php server or something else if this thing can read your vc-mp's database and make http requests.
No native way to do that.
Quote from: vito on May 14, 2016, 02:19 PMYou need proxy like a php server or something else if this thing can read your vc-mp's database and make http requests.
No native way to do that.
What about sockets though? Using database and a HTTP handler to get a JSON data from a website is complete shit.
Quote from: KAKAN on May 14, 2016, 04:11 PMQuote from: vito on May 14, 2016, 02:19 PMYou need proxy like a php server or something else if this thing can read your vc-mp's database and make http requests.
No native way to do that.
What about sockets though? Using database and a HTTP handler to get a JSON data from a website is complete shit.
Already been done, but the source code is lost.
http://viceunderdogs.com/index.php?topic=3087.msg35628#msg35628
I honestly wouldn't recommend running an HTTP server off Squirrel sockets since each request you have to handle takes processing time away from the scripts and server core.
Quote from: Stormeus on May 14, 2016, 04:27 PMQuote from: KAKAN on May 14, 2016, 04:11 PMQuote from: vito on May 14, 2016, 02:19 PMYou need proxy like a php server or something else if this thing can read your vc-mp's database and make http requests.
No native way to do that.
What about sockets though? Using database and a HTTP handler to get a JSON data from a website is complete shit.
Already been done, but the source code is lost.
http://viceunderdogs.com/index.php?topic=3087.msg35628#msg35628
I honestly wouldn't recommend running an HTTP server off Squirrel sockets since each request you have to handle takes processing time away from the scripts and server core.
Make it again pls, and also, I'm not going to run a HTTP server.
I'm trying to get a JSON from a page, which I think can be done from a sockets, but since, we can't change the connect string, it's not useful for me :(
Quote from: KAKAN on May 14, 2016, 04:11 PMWhat about sockets though? Using database and a HTTP handler to get a JSON data from a website is complete shit.
Compilte shit or nothing, simple choice for curret time xD
Quote from: . on Apr 19, 2016, 09:52 PMQuote from: vcmptr on Apr 19, 2016, 09:39 PMHTTP page downloader. Like this (http://php.net/manual/en/function.file-get-contents.php). I've tried with sockets but I could not.
I have that planned for a module that wraps the Mongoose (https://github.com/cesanta/mongoose) library. It's still a work in progress but when finished, it should provide a fully functional HTTP server/client with support for web-sockets for real time live maps (no more jsoon files). As well as TCP and UDP communications.
However, I need to implement that in a way that doesn't affect the frame-rate.Which means I'd have to run it into a separate thread. And since Squirrel is not a thread safe language. I'm not sure how to achieve that without creating a bottleneck from all the context switching to communicate between threads. Which means that this module is still pending for now.
And I can't see any safe and decent way of going with this so I might spend a while until I come up with something.
Quote from: KAKAN on May 14, 2016, 04:53 PMQuote from: Stormeus on May 14, 2016, 04:27 PMQuote from: KAKAN on May 14, 2016, 04:11 PMQuote from: vito on May 14, 2016, 02:19 PMYou need proxy like a php server or something else if this thing can read your vc-mp's database and make http requests.
No native way to do that.
What about sockets though? Using database and a HTTP handler to get a JSON data from a website is complete shit.
Already been done, but the source code is lost.
http://viceunderdogs.com/index.php?topic=3087.msg35628#msg35628
I honestly wouldn't recommend running an HTTP server off Squirrel sockets since each request you have to handle takes processing time away from the scripts and server core.
Make it again pls, and also, I'm not going to run a HTTP server.
I'm trying to get a JSON from a page, which I think can be done from a sockets, but since, we can't change the connect string, it's not useful for me :(
I think it's easy to do that.
Developers should fix the socket plugin's issue first. When the client send data to server, the server will crash. I have reported this months ago, but still havn't fixed yet.