-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
86 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Early sandbox repo playing around w/ getting signaling to work w/ WebRTC via IPFS. | ||
|
||
Result: IPFS is close but not quite ready for DHT. It doesn't have any bootstrappable peers that I can see and the built | ||
JS from current master is like 2.5MB minimized. Will be waiting... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
<head> | ||
<title>WebRTC IPFS Signalling Answerer</title> | ||
<script src="https://unpkg.com/[email protected]/dist/index.js"></script> | ||
<!-- <script src="js-ipfs.min.js"></script> --> | ||
<script src="browser.js"></script> | ||
</head> | ||
<body> | ||
|
@@ -36,8 +37,7 @@ <h3>WebRTC IPFS Signalling Answerer</h3> | |
location.reload() | ||
} | ||
// Create IPFS and do everything else once ready | ||
const ipfs = new Ipfs() | ||
ipfs.on('ready', () => { | ||
newIPFS(ipfs => { | ||
console.log('IPFS ready') | ||
|
||
// Create new RTC conn | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
<head> | ||
<title>WebRTC IPFS Signalling Offerer</title> | ||
<script src="https://unpkg.com/[email protected]/dist/index.js"></script> | ||
<!-- <script src="js-ipfs.min.js"></script> --> | ||
<script src="browser.js"></script> | ||
</head> | ||
<body> | ||
|
@@ -36,8 +37,7 @@ <h3>WebRTC IPFS Signalling Offerer</h3> | |
location.reload() | ||
} | ||
// Create IPFS and do everything else once ready | ||
const ipfs = new Ipfs() | ||
ipfs.on('ready', () => { | ||
newIPFS(ipfs => { | ||
console.log('IPFS ready') | ||
|
||
// Create new RTC conn | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"net/http" | ||
) | ||
|
||
func main() { | ||
fs := http.FileServer(http.Dir(".")) | ||
err := http.ListenAndServe(":8080", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | ||
w.Header().Add("Access-Control-Allow-Origin", "*") | ||
fs.ServeHTTP(w, r) | ||
})) | ||
log.Fatal(err) | ||
} |