You need to create the CString into an AutOStringRef here then MCValueAssign to MChttpproxy (as MChttpproxy already holds an MCValueRef).