mirror of
https://github.com/matrix-org/pinecone.git
synced 2026-01-11 19:46:30 +00:00
Enable manhole on pinecone
This commit is contained in:
parent
b215925d55
commit
18cfdabc19
2 changed files with 9 additions and 1 deletions
|
|
@ -20,4 +20,4 @@ COPY --from=base /build/bin/* /usr/bin/
|
|||
EXPOSE 65432/tcp
|
||||
EXPOSE 65433/tcp
|
||||
|
||||
ENTRYPOINT ["/usr/bin/pinecone", "-listenws=:65433", "-listen=:65432"]
|
||||
ENTRYPOINT ["/usr/bin/pinecone", "-listenws=:65433", "-listen=:65432", "-manhole"]
|
||||
|
|
@ -62,6 +62,7 @@ func main() {
|
|||
listentcp := flag.String("listen", ":0", "address to listen for TCP connections")
|
||||
listenws := flag.String("listenws", ":0", "address to listen for WebSockets connections")
|
||||
connect := flag.String("connect", "", "peer to connect to")
|
||||
manhole := flag.Bool("manhole", false, "enable the manhole (requires WebSocket listener to be active)")
|
||||
flag.Parse()
|
||||
|
||||
if connect != nil && *connect != "" {
|
||||
|
|
@ -91,6 +92,13 @@ func main() {
|
|||
}
|
||||
})
|
||||
|
||||
if *manhole {
|
||||
fmt.Println("Enabling manhole on HTTP listener")
|
||||
http.DefaultServeMux.HandleFunc("/manhole", func(w http.ResponseWriter, r *http.Request) {
|
||||
pineconeRouter.ManholeHandler(w, r)
|
||||
})
|
||||
}
|
||||
|
||||
listener, err := listener.Listen(context.Background(), "tcp", *listenws)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue