Connect middleware for Law