Parse user-agent string for both inbound and outbound connections