Created
February 4, 2018 22:23
-
-
Save watzon/08a1c4b1d5eb0031b202c3d6194ee729 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio; | |
import std.array : split; | |
import vibe.core.net; | |
import vibe.stream.tls; | |
void main() | |
{ | |
auto addr = "149.154.167.40:443"; | |
auto addrParts = this.addr.split(":"); | |
writeln(addrParts); | |
auto conn = connectTCP(addrParts[0], to!ushort(addrParts[1])); | |
auto sslctx = createTLSContext(TLSContextKind.client); | |
auto stream = createTLSStream(conn, sslctx); | |
stream.write("Hello, World!"); | |
stream.finalize(); | |
conn.close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment