* 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>
This commit is contained in:
rockcavera
2021-02-22 13:40:57 -03:00
committed by GitHub
parent 2aba116bbc
commit d76d79336f
2 changed files with 34 additions and 5 deletions

View File

@@ -0,0 +1,22 @@
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()