data RawMode
= ICMP
| UDP Int
| FakeTCP Int
case rawMode of
ICMP -> "icmp"
UDP _ -> "udp"
FakeTCP _-> "faketcp"
case rawMode of
ICMP -> Nothing
UDP p -> Just p
FakeTCP p -> Just p
case Text.toLower (Text.strip t) of
"icmp" -> Just ICMP
"udp" -> Just(UDP (fromMaybe 443 port))
"faketcp" -> Just(FakeTCP (fromMaybe 443 port))
_ -> Nothing