anchor.diff:                  "bind_address" = "";
                   "port" = 8448;
                   "resources" = [
  -                  { "compress" = true; "names" = [ "client" "webclient" ]; }
  +                  { "compress" = true; "names" = [ "client" ]; }
                     { "compress" = false; "names" = [ "federation" ]; }
                   ];
                   "tls" = false;
  
positive.code:       client = { pkgs, ... }: {
          environment.systemPackages = [
            (pkgs.writers.writePython3Bin "do_test"
              { libraries = [ pkgs.python3Packages.matrix-client ]; } ''
              import socket
              from matrix_client.client import MatrixClient
              from time import sleep
  
              matrix = MatrixClient("${homeserverUrl}")
              matrix.register_with_password(username="alice", password="foobar")
  
              irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
              irc.connect(("ircd", 6667))
              irc.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
              irc.send(b"USER bob bob bob :bob\n")
              irc.send(b"NICK bob\n")
  
              m_room = matrix.join_room("#irc_#test:homeserver")
              irc.send(b"JOIN #test\n")
  
              # plenty of time for the joins to happen
              sleep(10)
  
              m_room.send_text("hi from matrix")
              irc.send(b"PRIVMSG #test :hi from irc \r\n")
  
              print("Waiting for irc message...")
              while True:
                  buf = irc.recv(10000)
                  if b"hi from matrix" in buf:
                      break
  
              print("Waiting for matrix message...")
  
  
              def callback(room, e):
                  if "hi from irc" in e['content']['body']:
                      exit(0)
  
  
              m_room.add_listener(callback, "m.room.message")
              matrix.listen_forever()
            ''
            )
          ];
  
negative.code:           homeserver.wait_for_open_port(8448)
  
        with subtest("ensure messages can be exchanged"):
            client.succeed("do_test >&2")
      '';
    })
  