Module: Threaded HTTP
3 Attachment(s)
This module implements an HTTP client in a threaded mode.
What is threaded? To avoid process blocking, this technique sends the request and wait for response in asynchronous way. At each StartFrame of hlds server, it checks if there's some pending request and in that case it checks for data in buffer. It's implemented using a free library HappyHTTP. How to use it? From the plugin, call the native: thttp_request Wait for the forward to be called: thttp_response Just that. Example plugin: Code:
#include <amxmodx> |
Re: Module: Threaded HTTP
You finally released it :) good job man
|
Re: Module: Threaded HTTP
Interesting :O I will use it:twisted: (When someone compile it to Windows :cry:).
GJ. |
Re: Module: Threaded HTTP
good job :3
|
Re: Module: Threaded HTTP
1 Attachment(s)
Try that.
@joropito : You don't include autoload in the .inc file. I've tried the .dll, and is it normal when you throw the command, it does not show always the result ? It seems to be shown randomly. Like I can use 4 times the command, nothing happens, then the 5th, it answers. If I try again, it appears. And the next time, not. etc. |
Re: Module: Threaded HTTP
Would be cool if you could set custom user-agent.
Perhaps thttp_request("thisisthekey", "this is custom useragent for this key"); |
Re: Module: Threaded HTTP
HappyHTTP (the library used) can send headers.
Here I just implemented a direct request. Of course more functions could, should and would be added :) |
Re: Module: Threaded HTTP
I have tried to use the compiled binary but it dosn't work. After thttp_request is called the response is never received or the forward is never called. Idk. Since I'm not clever enough maybe the reason is same as using socket for https. If not and someone can fix this would be nice to see with custom header option. :)
|
All times are GMT -4. The time now is 22:47. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.