Skip to content

truongsofm/anyproxy-router

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AnyProxy Router

Use multi callback for one event.

Before:

{
    * beforeSendRequest(requestDetail) {
        if(is-domain-a)
            return {....}
        
        if(is-domain-b)
            return {....}
        
        
        if(is-domain-c)
            return {....}
        
        return null
    },

    * beforeSendResponse(requestDetail) {
        .....
    },
}

Now:

{
    "{hostname: \"domain-a.com\"}" : {
        beforeSendRequest: [ActionA, ActionB],
        
        beforeSendResponse: [ActionC, ActionD],
    },

    
    "{hostname: \"domain-b.com\"}" : {
        beforeSendRequest: [ActionE, ActionF],
        
        beforeSendResponse: [ActionG, ActionH],
    },

    ....
}

See example for demo.

About

Router system for AnyProxy http://anyproxy.io

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%