func channelActive()

in Sources/NIOTSHTTPClient/main.swift [26:34]


    func channelActive(context: ChannelHandlerContext) {
        var head = HTTPRequestHead(version: .init(major: 1, minor: 1), method: .GET, uri: "/get")
        head.headers.add(name: "Host", value: "httpbin.org")
        head.headers.add(name: "User-Agent", value: "SwiftNIO")
        context.write(self.wrapOutboundOut(.head(head)), promise: nil)
        context.writeAndFlush(self.wrapOutboundOut(.end(nil)), promise: nil)

        print("Connected to \(context.channel.remoteAddress!) from \(context.channel.localAddress!)")
    }