| 778 | } |
| 779 | |
| 780 | func TestSerializeLocalConfig(t *testing.T) { |
| 781 | c := &newLocalConfig{ |
| 782 | RemoteConfig: ingress.RemoteConfig{ |
| 783 | Ingress: ingress.Ingress{}, |
| 784 | }, |
| 785 | ConfigurationFlags: map[string]string{"a": "b"}, |
| 786 | } |
| 787 | |
| 788 | result, err := json.Marshal(c) |
| 789 | require.NoError(t, err) |
| 790 | require.JSONEq(t, `{"__configuration_flags":{"a":"b"},"ingress":[],"warp-routing":{"connectTimeout":0,"tcpKeepAlive":0}}`, string(result)) |
| 791 | } |
| 792 | |
| 793 | func wsEcho(w http.ResponseWriter, r *http.Request) { |
| 794 | upgrader := gows.Upgrader{} |