You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* * added info on gateway habourmaster
* fixed broken examples with new infra addresses
* bump node version in ts sdk docs ci script
---------
Co-authored-by: mfahampshire <[email protected]>
Copy file name to clipboardExpand all lines: sdk/typescript/docs/pages/examples/mix-fetch.mdx
+21-13Lines changed: 21 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ import { Callout } from 'nextra/components'
4
4
5
5
An easy way to secure parts or all of your web app is to replace calls to [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) with `mixFetch`:
6
6
7
-
MixFetch works the same as vanilla `fetch` as it's a proxied wrapper around the original function.
7
+
MixFetch works the same as vanilla `fetch` as it's a proxied wrapper around the original function.
8
8
Sounds great, are there any catches? Well, there are a few (for now):
9
9
10
10
1. Currently, the operators of Network Requesters that make the final request at the egress part of the Nym mixnet to
@@ -16,30 +16,38 @@ in combination with their own configuration. If you are trying to access somethi
16
16
3. If you are using `mixFetch` in a web app with HTTPS you will need to use a gateway that has Secure Websockets to
17
17
avoid getting a [mixed content](https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content) error.
18
18
19
-
4. For now, mixfetch doesn't work with SURBS, altough this may change in the future.
19
+
4. For now, mixfetch doesn't work with SURBS, altough this may change in the future.
20
20
21
21
22
22
Read [this article](https://blog.nymtech.net/mixfetch-like-the-fetch-api-but-via-the-mixnet-82acfd435c62) to learn more about mixFetch.
23
23
24
24
<Callouttype="info"emoji="ℹ️">
25
-
We are currently working on a feature that adds a Secure Websocket (WSS) listener with HTTPS (automatically generated with LetsEncrypt) to Nym's
26
-
gateways.
27
-
While we are adding this feature, you can use a gateway that has Caddy providing HTTPS/WSS by adding this to the options when setting up `mixFetch`:
25
+
Right now Gateways are not required to run a Secure Websocket (WSS) listener, so only a subset of nodes running in Gateway mode have configured their nodes to do so.
26
+
27
+
For the moment you have to select a Gateway that has WSS enabled from [this list](https://harbourmaster.nymtech.net/v1/services?wss=true).
28
+
29
+
You can also find WSS-enabled nodes by querying the `gateways/described` endpoint on the Nym API, either via the [Swagger webpage](https://validator.nymtech.net/api/swagger/index.html) or with `curl`:
During the environment setup, choose React and subsequently opt for Typescript if you want your application to function smoothly following this tutorial. Next, navigate to your application directory and run the following commands:
54
62
```bash
55
63
cd< YOUR_APP >
56
-
npm i
64
+
npm i
57
65
npm run dev
58
66
```
59
67
@@ -74,17 +82,17 @@ import { mixFetch } from "@nymproject/mix-fetch-full-fat";
74
82
75
83
##### Example: using the `mixFetch` client:
76
84
77
-
`Get` and `Post` outputs will be observable from your console.
85
+
`Get` and `Post` outputs will be observable from your console.
Right now Gateways are not required to run a Secure Websocket (WSS) listener, so only a subset of nodes running in Gateway mode have configured their nodes to do so.
10
+
11
+
For the moment you have to select a Gateway that has WSS enabled from [this list](https://harbourmaster.nymtech.net/v1/services?wss=true).
12
+
13
+
You can also find WSS-enabled nodes by querying the `gateways/described` endpoint on the Nym API and filtering for `wss_port`, either via the [Swagger webpage](https://validator.nymtech.net/api/swagger/index.html) or with `curl`:
0 commit comments