Experiments with GoLang:
- Database + Domain
- Database singleton client connection
- Worker Pooling
- Client-Server
- SSL
- Web server go routines
Go, etc.
GCC (and make):
- Install via MSYS2 on Windows. MSYS2 still seems to be the best Windows Linux tools distribution around (2022). Will install a Linux terminal and add itself to Environment Variables automatically. Will come bundled with
pacman
. - I'd recommend the toolchain:
pacman -S mingw-w64-x86_64-toolchain
- You'll still need to add the
gcc
dir to the Environment Variables (C:\msys64\mingw64\bin
)PATH
.
If you run into pacman PGP key trust errors per this:
pacman-key --init
pacman-key --populate msys2
pacman-key --refresh-keys
Think the code repositories rotate keys every 3 months or so. Make sure to update those!
Execute the following commands to grab all the Go
dependencies manually:
go clean && go clean -modcache
go get github.com/gofrs/uuid
For a valid self-signed SSL:
openssl genrsa -out key.pem 2048
openssl req -new -sha256 -key key.pem -out csr.csr
openssl req -x509 -sha256 -days 365 -key key.pem -in csr.csr -out certificate.pem
Navigate to ./goserver:
go run httpsServer.go
You should see:
=================== POLLING EVERY 5s ===================
=================== POLLING EVERY 5s ===================
=================== POLLING EVERY 5s ===================
2023/02/02 16:55:38 http: TLS handshake error from [::1]:60797: remote error: tls: unknown certificate
2023/02/02 16:55:40 http: TLS handshake error from [::1]:60802: remote error: tls: unknown certificate
=================== POLLING EVERY 5s ===================
=================== POLLING EVERY 5s ===================
=================== POLLING EVERY 5s ===================
=================== POLLING EVERY 5s ===================