add support for using proxy over custom http error code

#149 & #148