async function connectAndWrite(address, port, socks = false) {
		/** @type {import("@cloudflare/workers-types").Socket} */
		let tcpSocket;
		if (config.socks5Relay) {
			tcpSocket = await socks5Connect(addressType, address, port, log, config.parsedSocks5Address)
		} else {
			tcpSocket = socks ? await socks5Connect(addressType, address, port, log, config.parsedSocks5Address)
				: connect({
					hostname: address,
					port: port,
				});
		}
		remoteSocket.value = tcpSocket;
		log(`connected to ${address}:${port}`);
		const writer = tcpSocket.writable.getWriter();
		await writer.write(rawClientData); // first write, normal is tls client hello
		writer.releaseLock();
		return tcpSocket;
	}
@type {import("@cloudflare/workers-types").Socket}