fix ssl bug
updated how proxy determines the referer
fixed previous referer bug