url - 如何从在 localhost 上运行的另一个程序访问在 localhost 上运行的程序
问题描述
我在本地机器上运行了两个程序:一个 wordpress 和一个 spring boot webservice 我如何从 wordpress 访问 webservice?我已经尝试了以下代码(如果没有“http://”,它也不起作用):
$response = wp_remote_get( 'http://localhost:8088/hello');
当然端口和路径是正确的,但是 localhost 上的两个应用程序似乎无法一起通信,对吗?
解决方案
如果有人遇到类似的问题,免费的解决方案是使用免费的 argo 隧道服务。我使用了 Cloudflare,效果很好,我认为您也可以使用 Ngrok。
有一个链接可以帮助您:https ://blog.cloudflare.com/a-free-argo-tunnel-for-your-next-project/
推荐阅读
- rust - 如何解除阻塞未来的线程并返回结果
- python - 如果条件,在python中分配错误的值
- java - 分组结果的方面计数
- c++ - win32 计时器是否归其调用线程所有?
- .net-core - 将 WSDL 添加到 .NET Core 项目
- javascript - 如何解决 ReferenceError: google 没有使用脚本在 Angular 中定义?
- php - 以相反的顺序显示最新的分类帖子
- mongodb - 使用sails js在mongo db中上传图像的简单方法
- redis - Vertx 3.7.0+ 使用 RedisAPI - HMSET
- r - 为 Dataframe 执行 R 代码时的因素错误