Skip to content

Commit

Permalink
add new website domain
Browse files Browse the repository at this point in the history
  • Loading branch information
alexliesenfeld committed Sep 11, 2024
1 parent 98423f6 commit f3e9b3c
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
- Record and Playback mode was added
- Many new matchers functions have been added
- Proxy Mode was added
- Website docs have been created (see https://alexliesenfeld.github.io/httpmock/)
- Website docs have been created (see https://httpmock.rs)
- HTTPS support added
- Internal implementation was entirely rewritten

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</div>

<p align="center">
<a href="https://alexliesenfeld.github.io/httpmock/">Website</a>
<a href="https://httpmock.rs">Website</a>
·
<a href="https://docs.rs/httpmock/">API Reference</a>
·
Expand Down Expand Up @@ -116,13 +116,13 @@ Docs: https://docs.rs/httpmock/0.8.0-alpha.1/httpmock/struct.When.html#metho

# Usage

See the [official website](http://alexliesenfeld.github.io/httpmock) for detailed API documentation.
See the [official website](http://httpmock.rs) for detailed API documentation.

## Examples

You can find examples in the
[`httpmock` test directory](https://github.com/alexliesenfeld/httpmock/blob/master/tests/).
The [official website](http://alexliesenfeld.github.io/httpmock) and [reference docs](https://docs.rs/httpmock/) also contain _**a lot**_ of examples.
The [official website](http://httpmock.rs) and [reference docs](https://docs.rs/httpmock/) also contain _**a lot**_ of examples.

## License

Expand Down
3 changes: 1 addition & 2 deletions docs/website/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import starlight from '@astrojs/starlight';

// https://astro.build/config
export default defineConfig({
site: 'https://alexliesenfeld.github.io/httpmock',
base: 'httpmock', // so that 'https://alexliesenfeld.github.io/httpmock' will be set as the base path
site: 'https://httpmock.rs',
integrations: [
starlight({
title: 'httpmock Tutorial',
Expand Down
2 changes: 1 addition & 1 deletion docs/website/src/content/docs/getting_started/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To learn more about this project, please refer to the following resources:
- Community Forum: https://github.com/alexliesenfeld/httpmock/discussions
- API Reference: https://docs.rs/httpmock/latest/httpmock/
- GitHub Repository: https://github.com/alexliesenfeld/httpmock
- Official Website: https://alexliesenfeld.github.io/httpmock
- Official Website: https://httpmock.rs
- Changelog: https://github.com/alexliesenfeld/httpmock/blob/master/CHANGELOG.md
- Discord Server: https://discord.gg/QrjhRh7A

Expand Down
20 changes: 20 additions & 0 deletions docs/website/src/content/docs/miscellaneous/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,23 @@ servers. You can adjust this limit by setting the `HTTPMOCK_MAX_SERVERS` environ
When the `httpmock` server receives a request that matches multiple mocks, they are evaluated in
reverse order of their definition. This means the most recently defined mock takes precedence and will be used.

### How does Proxy Mode work?

A mock server acts as a "man-in-the-middle" (MITM) proxy. Here's how it works:

* **Intercepting HTTPS Traffic**: When you configure your System Under Test to use mock server as a proxy,
the mock server intercepts the HTTPS traffic. Normally, in a CONNECT tunnel, the traffic would be encrypted end-to-end.
However, a mock server performs a MITM attack (with your consent, of course) to decrypt this traffic.
* **SSL/TLS Termination**: A mock server creates its own SSL/TLS connection with the client and another with
the target server. When the client sends an HTTPS request, it is intercepted by the mock server.
The mock server terminates the original SSL/TLS connection and establishes a new connection with the
actual destination server.
* **Certificate Authority (CA)**: To intercept and decrypt HTTPS traffic, mock server uses a self-signed
or a custom Certificate Authority (CA). This CA certificate is used to generate SSL certificates on the
fly for the destination servers. You need to configure the client (or system under test) to trust this CA,
which allows the mock server to decrypt the traffic. The client sees the proxy server as the legitimate
endpoint because it trusts the certificate issued by mock server.
* **Request/Response Handling**:
Once the traffic is decrypted, the mock server can read, modify, or log the HTTPS requests and responses.
After processing the request, the mock server forwards it to the actual destination server, receives
the response, and then re-encrypts it before sending it back to the client.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@
//!
//! # Usage
//!
//! See the [official website](http://alexliesenfeld.github.io/httpmock) a for detailed
//! See the [official website](http://httpmock.rs) a for detailed
//! API documentation.
//!
//! ## Examples
//!
//! You can find examples in the
//! [`httpmock` test directory](https://github.com/alexliesenfeld/httpmock/blob/master/tests/).
//! The [official website](http://alexliesenfeld.github.io/httpmock) and [reference docs](https://docs.rs/httpmock/)
//! The [official website](http://httpmock.rs) and [reference docs](https://docs.rs/httpmock/)
//! also contain _**a lot**_ of examples.
//!
//! ## License
Expand Down

0 comments on commit f3e9b3c

Please sign in to comment.