a app that proxy http post/get from server to local server
JavaScript
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
LICENSE
README.md
client.js
config-sample.js
package.json
server.js

README.md

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