add connect/request middleware