mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
13 lines
186 B
Nim
13 lines
186 B
Nim
import sockets, os
|
|
var s: TSocket
|
|
s = socket()
|
|
if s == InvalidSocket: osError(osLastError())
|
|
|
|
s.connect("www.google.com", TPort(80))
|
|
|
|
var data: string = ""
|
|
s.readLine(data)
|
|
echo(data)
|
|
|
|
|