This is not a legal way, you must notice consulate whenever you change your address. If you fail to do that, your case will be denied or you will be deported even you get visa because of treating, also that will trigger 2years unadmittable bar. Definitely they will find that because of medical exam and possible interview, especially med exam is required to be performed in the place where you live.
So, try to stay in Canada or US if you want to apply in Buffalo, or apply in Beijing.
So, try to stay in Canada or US if you want to apply in Buffalo, or apply in Beijing.