vkuznet / transfer2go

Distributed, loosely couple agent-based transferring system
MIT License
8 stars 2 forks source link

Add smart router #42

Closed rishiloyola closed 7 years ago

rishiloyola commented 7 years ago

Note: Do not merge this. I will keep pushing my work under this branch.

vkuznet commented 7 years ago

I think you need to implement a goroutine/metrics which will constantly monitor the agent. You can't just use snapshot since it is not representative. Since we already have some support for metrics you may extend them and keep historical info around in terms of them.

rishiloyola commented 7 years ago

@vkuznet That makes sense. I will update it.

rishiloyola commented 7 years ago

TODO:

rishiloyola commented 7 years ago

@vkuznet Can you review it and merge it? I will write a formula and improve my scheduling algorithm during this week.

vkuznet commented 7 years ago

Still wrong. Every agent is registered with main one. Therefore every agent knows explicitly main agent URL. As such an agent will make call

/html/client.html And another way around, main agent knows about all other agents, therefore this information is known. I don't see any reason (yet) why you need to open such flaw. On 0, Rishi wrote: > rishiloyola commented on this pull request. > > > > > @@ -393,6 +440,8 @@ func ActionHandler(w http.ResponseWriter, r *http.Request) { > > // TFCHandler registers given record in local TFC > func TFCHandler(w http.ResponseWriter, r *http.Request) { > + // allow cross domain AJAX requests > + w.Header().Set("Access-Control-Allow-Origin", "*") > > Valentin, > I am allowing cross domain AJAX requests on few endpoints so that anyone can run our agent on any machine and can place a request or register new data to the main-agent. > > So, let's say main-agent is running on localhost:8989 and you are running your agent on localhost:8000. Now in order to register new transfer request, you can access HTML pages of your agent through this link - http://localhost:8000/html/client.html and can send HTTP post request to main-agent(localhost:8989) to register new request. > > -- > You are receiving this because you modified the open/close state. > Reply to this email directly or view it on GitHub: > https://github.com/vkuznet/transfer2go/pull/42#discussion_r135574174