diff options
author | Kegsay <kegan@matrix.org> | 2020-07-02 17:11:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-02 17:11:33 +0100 |
commit | 9c1f38621c4d787761092bc841e06ca424fbbf35 (patch) | |
tree | c7663e2f1f0af6414d1d66567265f5158360d8f2 /cmd/client-api-proxy/main.go | |
parent | 4c1e6597c0ea82f5390b73f35036db58e65542cc (diff) |
Remove publicroomsapi (#1176)
* Remove all of publicroomsapi
* Remove references to publicroomsapi
* Remove doc references to publicroomsapi
Diffstat (limited to 'cmd/client-api-proxy/main.go')
-rw-r--r-- | cmd/client-api-proxy/main.go | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/cmd/client-api-proxy/main.go b/cmd/client-api-proxy/main.go index ebc0629f..742ec3e3 100644 --- a/cmd/client-api-proxy/main.go +++ b/cmd/client-api-proxy/main.go @@ -48,13 +48,12 @@ Arguments: ` var ( - syncServerURL = flag.String("sync-api-server-url", "", "The base URL of the listening 'dendrite-sync-api-server' process. E.g. 'http://localhost:4200'") - clientAPIURL = flag.String("client-api-server-url", "", "The base URL of the listening 'dendrite-client-api-server' process. E.g. 'http://localhost:4321'") - mediaAPIURL = flag.String("media-api-server-url", "", "The base URL of the listening 'dendrite-media-api-server' process. E.g. 'http://localhost:7779'") - publicRoomsAPIURL = flag.String("public-rooms-api-server-url", "", "The base URL of the listening 'dendrite-public-rooms-api-server' process. E.g. 'http://localhost:7775'") - bindAddress = flag.String("bind-address", ":8008", "The listening port for the proxy.") - certFile = flag.String("tls-cert", "", "The PEM formatted X509 certificate to use for TLS") - keyFile = flag.String("tls-key", "", "The PEM private key to use for TLS") + syncServerURL = flag.String("sync-api-server-url", "", "The base URL of the listening 'dendrite-sync-api-server' process. E.g. 'http://localhost:4200'") + clientAPIURL = flag.String("client-api-server-url", "", "The base URL of the listening 'dendrite-client-api-server' process. E.g. 'http://localhost:4321'") + mediaAPIURL = flag.String("media-api-server-url", "", "The base URL of the listening 'dendrite-media-api-server' process. E.g. 'http://localhost:7779'") + bindAddress = flag.String("bind-address", ":8008", "The listening port for the proxy.") + certFile = flag.String("tls-cert", "", "The PEM formatted X509 certificate to use for TLS") + keyFile = flag.String("tls-key", "", "The PEM private key to use for TLS") ) func makeProxy(targetURL string) (*httputil.ReverseProxy, error) { @@ -121,13 +120,6 @@ func main() { fmt.Fprintln(os.Stderr, "no --media-api-server-url specified.") os.Exit(1) } - - if *publicRoomsAPIURL == "" { - flag.Usage() - fmt.Fprintln(os.Stderr, "no --public-rooms-api-server-url specified.") - os.Exit(1) - } - syncProxy, err := makeProxy(*syncServerURL) if err != nil { panic(err) @@ -140,14 +132,8 @@ func main() { if err != nil { panic(err) } - publicRoomsProxy, err := makeProxy(*publicRoomsAPIURL) - if err != nil { - panic(err) - } http.Handle("/_matrix/client/r0/sync", syncProxy) - http.Handle("/_matrix/client/r0/directory/list/", publicRoomsProxy) - http.Handle("/_matrix/client/r0/publicRooms", publicRoomsProxy) http.Handle("/_matrix/media/v1/", mediaProxy) http.Handle("/", clientProxy) @@ -159,8 +145,6 @@ func main() { fmt.Println("Proxying requests to:") fmt.Println(" /_matrix/client/r0/sync => ", *syncServerURL+"/api/_matrix/client/r0/sync") - fmt.Println(" /_matrix/client/r0/directory/list => ", *publicRoomsAPIURL+"/_matrix/client/r0/directory/list") - fmt.Println(" /_matrix/client/r0/publicRooms => ", *publicRoomsAPIURL+"/_matrix/media/client/r0/publicRooms") fmt.Println(" /_matrix/media/v1 => ", *mediaAPIURL+"/api/_matrix/media/v1") fmt.Println(" /* => ", *clientAPIURL+"/api/*") fmt.Println("Listening on ", *bindAddress) |