mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 21:40:32 +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>
This commit is contained in:
22
tests/stdlib/tnetconnect.nim
Normal file
22
tests/stdlib/tnetconnect.nim
Normal 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()
|
||||
Reference in New Issue
Block a user