![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
一个快速打通本地开发环境和阿里云云上 vpc 具体实例 tcp 网络的简洁工具
$ pip install fc-tunnel
{
"akId": "your aliyun ak id",
"akSecret": "your aliyun ak secret",
"accountId": "your aliyun main account id",
"region": "cn-beijing",
"vpcId": "vpc-2zes9muk32e82wwt7kfef",
"vSwitchIds": "vsw-2zek7r3kcvmu3div13bh4",
"securityGroupId": "sg-2zed3dvbh98kzoi3cch5",
"remoteIP": "10.20.108.195",
"remotePorts": "8080,9000"
}
其中:
{
"Statement": [
{
"Effect": "Allow",
"Action": "tns:*",
"Resource": "*"
}
],
"Version": "1"
}
remoteIP 表示云上阿里云 vpc 的内网地址, 具体可以是 SAE 应用的实例内部 IP, ECI 实例的内部 IP, ECS 内网 IP 等
remotePorts 对应 remoteIP 实例映射到本地的端口
如上面的 config.json 所示, 如果您有一个 vpc 内置地址为 10.20.108.195 的 SAE 实例, 这个 SAE 实例上跑的是一个 java SpringBoot 的应用, 8080 是 web 服务端口, 9000 是远程调试的端口
$ fct -c config.json
耐心等待, 直到输出 Session is OK! now you can remote debug
, 注意不要关闭这个终端。
以上面那个 config.json 为例, 这个时候:
可以直接使用 http://127.0.0.1:8080
访问 SpringBoot 网站
直接使用本地 IDE IDEA 上的源码对实例上的 jar 包进行远程调试
当然您也可以借助本地的代理容器实例,作为跳板机, 实现对云上具体实例的管理操作
$ docker ps -a | grep VPN-Local
d46a86c27abd registry.cn-beijing.aliyuncs.com/aliyunfc/vpn-local-proxy:v0.0.1 "/usr/app/start.sh" 5 minutes ago Up 5 minutes 0.0.0.0:8080->8080/tcp, 0.0.0.0:9000->9000/tcp VPN-Local-S-5ecc9bda-6d83-4f5d-884c-6739d8a3925e
$ docker exec -it d46a86c27abd bash
root@d46a86c27abd:/usr/app# telnet 10.20.108.195 8080
Trying 10.20.108.195...
Connected to 10.20.108.195.
Escape character is '^]'.
调试完毕后, 直接 CTRL+C
结束建立通道命令执行的那个终端, 会自动执行清理 FC 资源操作, 尤其是会自动取消有付费的预留
通道建立借助了 Serverless 的 FC 128M 实例, FC的计费粒度精确到毫秒计费
函数实例资源使用量:每月前400,000 GB-秒函数实例资源使用量免费
即使不考虑每个月的免费额度,我们这里折算成小时, 也就是您调试 1h, 费用大约为 0.000110592元/GB-秒128/10243600 =0.0497 元
FAQs
Use FC to open up the tunnel between the local and Alibaba Cloud vpc network
We found that fc-tunnel demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.