Add Support for Custom HTTP Headers in agent-python via Argument #55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi guys,
I was using Hashtopolis inside a Docker container inside a VPS, however I wanted to integrated vast.ai to act as my agents and so for that I had to expose the VPS to the internet. That's not good in my opinion as we could get a lot of traffic from people trying to bruteforce the login form.
Knowing this I implemented a Cloud Flare Tunnel exposing port 8080 localy and assigned to a domain of my own - adding to this I also created an access rule that only people with a certain CF header can access that login form, thus making this login form protected.
Everything worked just fine however the agent-python was not prepared to deal with this kind of authentication since the requests being made dont use any kind of authentication mechanism and there's no argumment available to do this right now.
This pull request adds a new flag called
http-headers
that is optional but if used these headers will be used on the Session.py and jsonRequest.py thus making it possible to authenticate in the CF Tunnel and make requests to the Hashtopolis Server.I tested all of this using vast.ai agents and everything worked just fine!
Please tell me if you guys need anything to be changed as I am willing to help
Thanks!