diff options
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | main/Main.hs | 7 |
2 files changed, 10 insertions, 0 deletions
@@ -128,6 +128,9 @@ Reject device attachment request or verification code of selected peer. `/peer-add <host> [<port>]` Manually add network peer with given hostname or IP address. +`/peer-add-public` +Add known public network peer(s). + `/peer-drop` Drop the currently selected peer. Afterwards, the connection can be re-established by either side. diff --git a/main/Main.hs b/main/Main.hs index f52e22a..0eb414c 100644 --- a/main/Main.hs +++ b/main/Main.hs @@ -418,6 +418,7 @@ commands = [ ("history", cmdHistory) , ("peers", cmdPeers) , ("peer-add", cmdPeerAdd) + , ("peer-add-public", cmdPeerAddPublic) , ("peer-drop", cmdPeerDrop) , ("send", cmdSend) , ("update-identity", cmdUpdateIdentity) @@ -472,6 +473,12 @@ cmdPeerAdd = void $ do addr:_ <- liftIO $ getAddrInfo (Just $ defaultHints { addrSocketType = Datagram }) (Just hostname) (Just port) liftIO $ serverPeer server (addrAddress addr) +cmdPeerAddPublic :: Command +cmdPeerAddPublic = do + server <- asks ciServer + addr:_ <- liftIO $ getAddrInfo (Just $ defaultHints { addrSocketType = Datagram }) (Just "discovery1.erebosprotocol.net") (Just (show discoveryPort)) + void $ liftIO $ serverPeer server (addrAddress addr) + cmdPeerDrop :: Command cmdPeerDrop = do dropPeer =<< getSelectedPeer |