Created
August 14, 2021 04:40
-
-
Save hellojukay/fc9eaebb1cef9bb6f6effb1ad950506d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let () = | |
let sock = Unix.socket Unix.PF_INET Unix.SOCK_STREAM 0 in | |
let address = Unix.inet_addr_of_string "127.0.0.1" in | |
let socket_address = Unix.ADDR_INET (address, 22) in | |
Unix.connect sock socket_address; | |
let buffer = Bytes.create 1024 in | |
let len = Unix.read sock buffer 0 (Bytes.length buffer) in | |
Printf.printf "%d %s" len (Bytes.to_string buffer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
vagrant@archlinux tcp $ dune exec ./tcp.exe
21 SSH-2.0-OpenSSH_8.6