Connect middleware to bucket user-agent strings into device groups