MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby. MockServer also includes a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and… http://mock-server.com
Documentation
For usage guide please see: www.mock-server.com
Versions
Maven Central
Maven Central contains the following MockServer artifacts:
- mockserver-netty - an HTTP(S) web server that mocks and records requests and responses
- mockserver-netty:jar-with-dependencies - mockserver-netty (as above) with all dependencies embedded
- mockserver-war - a deployable WAR for mocking HTTP(S) responses (for any JEE web server)
- mockserver-proxy-war - a deployable WAR that records requests and responses (for any JEE web server)
- mockserver-maven-plugin - a maven plugin to start, stop and fork MockServer using maven
- mockserver-client-java - a Java client to communicate with both the server and the proxy
In addition MockServer SNAPSHOT artifacts can also be found on Sonatype.
Node Module & Grunt Plugin
NPM Registry contains the following module:
- mockserver-node - a Node.js module and Grunt plugin to start and stop MockServer
- mockserver-client-node - a Node.js client for both the MockServer and the proxy
Docker Hub
Docker Hub contains the following artifacts:
- MockServer Docker Container - a Docker container containing the Netty MockServer and proxy
Helm Chart
- MockServer Helm Chart - a Helm Chart that installs MockServer to a Kubernetes cluster, available versions:
MockServer Clients
- mockserver-client-ruby - Ruby client for both the MockServer and the proxy
- mockserver-client-java - a Java client for both the MockServer and the proxy
- mockserver-client-node - a Node.js and browser client for both the MockServer and the proxy
-------------------
What is MockServer Proxy
MockServer Proxy can be used for transparently recording all requests sent by a system (i.e. an application or set of applications).
MockServer Proxy can:
- proxy all requests using any of the following proxying methods:
- Port Forwarding
- Web Proxying (i.e. HTTP proxy)
- HTTPS Tunneling Proxying (using HTTP CONNECT)
- SOCKS Proxying (i.e. dynamic port forwarding)
- verify requests have been sent (i.e. in a test assertion)
- record requests and responses to analyse how a system behaves
The MockServer Proxy provides the following features:
- Port Forwarding
- all requests for a specific local port are forwarded to a different (local or remote) port and hostname for the system being proxied
- to proxy requests the HTTP client should use the hostname and port of the MockServer Proxy instead of the system being proxied
- Web Proxying (i.e. HTTP proxy)
- each request is forwarded dynamically using its Host header
- to proxy requests the HTTP client should be configured to use an HTTP Proxy
- Secure Web Proxying (i.e. HTTPS tunneling proxying)
- requests are forwarded using a CONNECT request that setups an HTTP tunnel
- an SSL certificate is auto-generated allowing encrypted HTTPS traffic to be recorded transparently
- to proxy requests the HTTP client should be configured to use an HTTP Proxy
- SOCKS Proxying (i.e. dynamic port forwarding)
- requests are forwarded using a SOCK CONNECT CMD request that established a socket tunnel
- if the traffic is encrypted an SSL certificate is auto-generated allowing SSL traffic to be recorded transparently
- to proxy requests the operating system (or JVM) should be configured to use an HTTP Proxy
- SSL & Certificates
- all SSL traffic is handled transparently by auto-generating an appropriate SSL certificate
- generated certificates use a single MockServer root CA certificate enabling the root certificate to be easily imported
- Port Unification
- to simplify configuration all protocols (i.e. HTTP, HTTPS / SSL, SOCKS, etc) are supported on the same port
- the protocol is dynamically detected by both MockServer and MockServer Proxy
FROM mock-server.com