The following example will result in a both a MockServer being started on ports 10. In your project's Gruntfile, add a section named start_mockserver and stop_mockserver to the data object passed into grunt.initConfig(). If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. A client can then connect to the single port with both HTTP and HTTPS as the socket will automatically detected SSL traffic and decrypt it when required. MockServer uses port unification to support HTTP, HTTPS, SOCKS, HTTP CONNECT, Port Forwarding Proxying on the same port. Then you can use either the start_mockserver or stop_mockserver functions as follows: var mockserver = require( 'mockserver-node') To start or stop the MockServer from any Node.js code you need to import this module using require( 'mockserver-node') as follows: var mockserver = require( 'mockserver-node') Note that nodemodules will only appear after installing the first package. This command will install the express module in the nodemodules folder in the root project directory. You may install this plugin / node module with the following command: npm install mockserver-node -save-dev For example, if you wish to install express, a popular web framework that simplifies standard web development processes, use the following command. The node module can be used to start and stop MockServer as a node module or as a Grunt plugin. mockserver-client - node client for MockServer and its proxy.mockserver-node - node module and grunt taks to start and stop MockServer and its proxy.
0 Comments
Leave a Reply. |