mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-16 15:40:01 -04:00
express setup (mfw 40s connect time)
This commit is contained in:
parent
d736ec6653
commit
4a12337f77
4 changed files with 318 additions and 28 deletions
|
@ -29,6 +29,18 @@ export default class App extends Component {
|
|||
console.log("offer created", offer);
|
||||
console.log(JSON.stringify(offer));
|
||||
|
||||
const r = await fetch("http://localhost:3000/connect", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(offer),
|
||||
});
|
||||
if (r.status != 200) {
|
||||
throw new Error("connect: " + r.status + " " + r.statusText);
|
||||
}
|
||||
const { answer, candidates } = await r.json();
|
||||
await this.rtc.answer(answer, candidates);
|
||||
alert("connected");
|
||||
|
||||
// setOffer(JSON.stringify(offer));
|
||||
|
||||
// this.setState(prev => ({ ...prev, offer: JSON.stringify(offer) }));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue