Files
Nim/tests/stdlib/tnetconnect.nim
rockcavera d76d79336f fix #15215 (#17142)
* fix 15215

* fix test

* end line

* Update tests/stdlib/tnetconnect.nim

Co-authored-by: flywind <xzsflywind@gmail.com>

* Update lib/pure/net.nim

Co-authored-by: flywind <xzsflywind@gmail.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-02-22 17:40:57 +01:00

23 lines
396 B
Nim

discard """
cmd: "nim c -r -d:ssl $file"
exitcode: 0
"""
import std/net
# Issue 15215 - https://github.com/nim-lang/Nim/issues/15215
proc test() =
var
ctx = newContext()
socket = newSocket()
wrapSocket(ctx, socket)
connect(socket, "www.nim-lang.org", Port(443), 5000)
send(socket, "GET / HTTP/1.0\nHost: www.nim-lang.org\nConnection: close\n\n")
close(socket)
test()