conncet middlewaer samples