mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
* 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>
23 lines
396 B
Nim
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()
|