Skip to content

zxdong262/zproxy

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

zproxy

a app proxy http(s) post/get from server to local server.

how it works

remote request--http(s) request--> zproxy server --web socket--> local websocket client -->
--http(s)--> local http(s) server  -->

--http(s) response--> local websocket client --web socket--> zproxy server 
--http(s) response--> remote request 

limited power

it has limited power, can only handle post/get http(s) request, and only one request once, so, can be used at some test cases only.

how to use

git clone git@github.com:zxdong262/zproxy.git
cd zproxy
cp config-sample.js config.js
npm i

then edit config.js

//local setting
module.exports = {
    portServer: 7213 //server http server port
    ,portWsServer: 7214 //server websocket port
    ,localServer: 'http://127.0.0.1:7204' //local server addr
    ,listenAddrServer: '127.0.0.1' //server http server listen address
    ,siteName: 'zproxy' //sitename
    ,serverWsAddr: '127.0.0.1' //server websocket listen address

    /* if use ssl
    ,sslOption: {
        ssl: {
            key: fs.readFileSync('path/to/your-server.key.pem')
            ,cert: fs.readFileSync('path/to/your-server.server.pem')
        }
        ,portServer: 7300
    }
    */
}

run the server

node server

run the client

node client

test

git clone git@github.com:zxdong262/zproxy.git
cd zproxy
npm i

#test http
cp config-sample.js config.js
node server.js
node client.js
node test/test-server.js
mocha test/test.js

#test https
cp test/config-sample-https.js config.js
node server.js
node client.js
node test/test-server-https.js
mocha test/test-https.js

license

MIT

About

a app that proxy http post/get from server to local server

Resources

License

Stars

Watchers

Forks

Packages

No packages published