You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 10, 2024. It is now read-only.
This comment on lobste.rs gives a clever way of adding opportunistic TLS support to a Gopher daemon. Here's the outline in C:
recv(socket, buf, sizeof(buf), MSG_PEEK)); /* add error handling though */
if (buf[0] == 0x12 || buf[0] == 0x16) {
tls_init(socket); /* normal TLS functions still work there */
gopher_read = tls_read;
} else {
gopher_read = read;
}
/* no special case for TLS or SSL to add */
handle_gopher(socket, gopher_read);
This comment on lobste.rs gives a clever way of adding opportunistic TLS support to a Gopher daemon. Here's the outline in C:
This ought to be possible with buffered IO in Go.