Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
19d4d66f
Commit
19d4d66f
authored
Nov 10, 2018
by
Dr Ian Preston
Committed by
Steven Allen
Nov 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update p2p http proxy docs
License: MIT Signed-off-by:
Ian Preston
<
ianopolous@protonmail.com
>
parent
47d45c7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
docs/experimental-features.md
docs/experimental-features.md
+8
-7
No files found.
docs/experimental-features.md
View file @
19d4d66f
...
...
@@ -393,7 +393,7 @@ Experimental
### In Version
master, 0.4.1
8
master, 0.4.1
9
### How to enable
...
...
@@ -415,7 +415,7 @@ On the client, the p2p http proxy needs to be enabled in the config:
First, pick a protocol name for your application. Think of the protocol name as
a port number, just significantly more user-friendly. In this example, we're
going to use `
test
`.
going to use `
/http
`.
***Setup:***
...
...
@@ -430,15 +430,15 @@ port `$APP_PORT`.
Then, configure the p2p listener by running:
```sh
> ipfs p2p listen --allow-custom-protocol
test
/ip4/127.0.0.1/tcp/$APP_PORT
> ipfs p2p listen --allow-custom-protocol
/http
/ip4/127.0.0.1/tcp/$APP_PORT
```
This will configure IPFS to forward all incoming `
test
` streams to
This will configure IPFS to forward all incoming `
/http
` streams to
`
127.0.0.1:$APP_PORT
` (opening a new connection to `
127.0.0.1:$APP_PORT
` per incoming stream.
***On the "client" node:***
Next, have your application make a http request to `
127.0.0.1:
5001/proxy/htt
p/$SERVER_ID/
$PROTOCOL
/$FORWARDED_PATH
`. This
Next, have your application make a http request to `
127.0.0.1:
8080/p2
p/$SERVER_ID/
http
/$FORWARDED_PATH
`. This
connection will be forwarded to the service running on `
127.0.0.1:$APP_PORT
` on
the remote machine (which needs to be a http server!) with path `
$FORWARDED_PATH
`. You can test it with netcat:
...
...
@@ -449,15 +449,16 @@ the remote machine (which needs to be a http server!) with path `$FORWARDED_PATH
***On "client" node:***
```sh
> curl http://localhost:
5001/proxy/htt
p/$SERVER_ID/
test
/
> curl http://localhost:
8080/p2
p/$SERVER_ID/
http
/
```
You should now see the resulting http response: IPFS rocks!
### Custom protocol names
We also support use of protocol names of the form /x/$NAME/http where $NAME doesn't contain any "/"'s
### Road to being a real feature
- [ ] Needs p2p streams to graduate from experiments
- [ ] Decide how to handle protocol names with /'s in them
- [ ] Needs more people to use and report on how well it works / fits use cases
- [ ] More documentation
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment