mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Do simple HTTP POST signaling in the client.
This is just enough to be compatible with the HTTP signaling in the server, and doesn't do domain fronting or anything like that. It's just an interim replacement for the copy-paste FIFO signaling while we continue to develop the other pieces that'll be dropped in the middle.
This commit is contained in:
parent
c9eeff6fc2
commit
e0b36d2f33
2 changed files with 38 additions and 9 deletions
|
@ -82,3 +82,19 @@ func (m *MeekChannel) Negotiate(offer *webrtc.SessionDescription) (
|
|||
answer := webrtc.DeserializeSessionDescription(string(body))
|
||||
return answer, nil
|
||||
}
|
||||
|
||||
// Simple interim non-fronting HTTP POST negotiation, to be removed when more
|
||||
// general fronting is present.
|
||||
func sendOfferHTTP(url string, offer *webrtc.SessionDescription) (*webrtc.SessionDescription, error) {
|
||||
resp, err := http.Post(url, "", bytes.NewBuffer([]byte(offer.Serialize())))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
answer := webrtc.DeserializeSessionDescription(string(body))
|
||||
return answer, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue