mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Refactor proxy to reuse signaling code
Simplify proxy interactions with the broker signaling server and prepare for the introduction of an additional signaling server.
This commit is contained in:
parent
912bcae24e
commit
7a0428e3b1
2 changed files with 61 additions and 58 deletions
|
@ -337,7 +337,7 @@ func TestBrokerInteractions(t *testing.T) {
|
|||
const sampleAnswer = `{"type":"answer","sdp":` + sampleSDP + `}`
|
||||
|
||||
Convey("Proxy connections to broker", t, func() {
|
||||
broker := new(Broker)
|
||||
broker := new(SignalingServer)
|
||||
broker.url, _ = url.Parse("localhost")
|
||||
|
||||
//Mock peerConnection
|
||||
|
@ -417,7 +417,8 @@ func TestBrokerInteractions(t *testing.T) {
|
|||
}
|
||||
err = broker.sendAnswer("test", pc)
|
||||
So(err, ShouldNotEqual, nil)
|
||||
So(err.Error(), ShouldResemble, "broker returned 410")
|
||||
So(err.Error(), ShouldResemble,
|
||||
"error sending answer to broker: remote returned status code 410")
|
||||
|
||||
//Error if we can't parse broker message
|
||||
broker.transport = &MockTransport{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue