pub fn fromScheme(scheme: []const u8) ?Protocol scheme: []const u8214
215
216
217
218
219
220
221
222 pub fn fromScheme(scheme: []const u8) ?Protocol {
const protocol_map = std.StaticStringMap(Protocol).initComptime(.{
.{ "http", .plain },
.{ "ws", .plain },
.{ "https", .tls },
.{ "wss", .tls },
});
return protocol_map.get(scheme);
}