authtoken
natapp.exe
natapp -authtoken=上文提到的authtoken
。命令行会出现类似Forwarding http://smalle.natappfree.cc -> 127.0.0.1:80
的显示。(表示访问在浏览器中访问http://smalle.natappfree.cc时相当于本地访问127.0.0.1:80) D:/software/natapp.exe -authtoken=12347dc3f25a1234
本地项目是基于nginx反向代理服务器实现(apache也可)
nginx.conf
文件,如:
server { listen 80; server_name localhost; location / { root C:/Users/smalle/Desktop/web; index index.html index.htm; }
MP_verify_2DCaFsV02WRKw123.txt
的文件下载到root路径下xyabcd.natappfree.cc
(不需要http://)保存即可http://smalle.natappfree.cc/api/auth?code=021GT83e1ucjUu035F0e1Ttg3e1GT812
就会被转发到http://127.0.0.1:8080/api/auth?code=021GT83e1ucjUu035F0e1Ttg3e1GT812
var url = "http://smalle.natappfree.cc/api/auth?code=" + code; $.get(url, function(res) { console.log(res); });
相关文章:服务号使用微信网页授权(H5应用等)