inigo-aldama/inmovilla-api-proxy
Composer 安装命令:
composer create-project inigo-aldama/inmovilla-api-proxy
包简介
A proxy server for interacting with the Inmovilla API, designed for environments with restricted IP access.
README 文档
README
inmovilla-api-proxy is a tool designed to solve a specific problem when interacting with the Inmovilla API: IP-based access restrictions.
Note: This project is not affiliated with, endorsed by, or maintained by Inmovilla.
Why Use Inmovilla API Proxy?
Inmovilla restricts access to their API to specific IP addresses. This becomes a problem when you're developing from a machine outside the allowed IP range. Here's how the situation looks:
-
Production server with
inmovilla-api-clientinstalled
✅ Can connect to the Inmovilla API (IP is allowed). -
Development machine with
inmovilla-api-clientinstalled
❌ Cannot connect to the Inmovilla API (IP is not allowed).
This package solves the issue by enabling the production server to act as a proxy. With inmovilla-api-proxy installed on the production server:
- Your development machine sends requests to the production server (acting as the proxy).
- The production server forwards these requests to the Inmovilla API.
- The response from the Inmovilla API is sent back to your development machine.
How It Works
Here’s a visual representation of the interaction flow between the Development Server, Production Server, and the Inmovilla API:
Production Server
inmovilla-api-clientis installed to send API requests to Inmovilla.inmovilla-api-proxyis installed to act as a proxy for requests from the development machine.
Development Machine
inmovilla-api-clientis installed to send requests to the proxy on the production server.
Example Flow
-
Without Proxy
- Development server → Direct connection to Inmovilla API → ❌ IP not allowed.
-
With Proxy
- Development server → Proxy on production server → Inmovilla API → ✅ Works.
Requirements
- PHP: 7.4 or higher.
- Composer: For dependency management.
- Libraries:
Installation
-
Install the Proxy on the Production Server Clone the repository or use Composer:
composer require inigo-aldama/inmovilla-api-proxy
-
Configure API Credentials Update the
api.iniconfiguration file on both servers (development and production):api.inion the production server:api_url = "https://api.inmovilla.com/v1" domain = "production-domain.com" agency = "production-agency" password = "production-password" language = 1
api.inion the development server:api_url = "http://production-server-url/api-proxy" domain = "production-domain.com" agency = "development-agency" password = "development-password" language = 1
Usage
-
On the Production Server Deploy
inmovilla-api-proxywith the following setup:<?php require 'vendor/autoload.php'; use Inmovilla\ApiClient\ApiClientConfig; use Inmovilla\Proxy\ProxyService; use GuzzleHttp\Client as GuzzleClient; use GuzzleHttp\Psr7\HttpFactory; $serverConfig = ApiClientConfig::fromIniFile(__DIR__ . '/config/api.ini'); $httpClient = new GuzzleClient(); $requestFactory = new HttpFactory(); $proxyService = new ProxyService($httpClient, $requestFactory, $serverConfig); $input = file_get_contents('php://input'); $response = $proxyService->handleRequest($input); header('Content-Type: application/json'); echo json_encode($response);
-
On the Development Machine Configure
api_urlto point to the production server's proxy, and useinmovilla-api-clientas usual.
Key Points
- The proxy must be installed on the production server; it's not needed on the development machine.
- The
api.iniconfiguration must exist on both servers:- The production server uses the real Inmovilla API URL.
- The development machine points
api_urlto the proxy URL.
Data Sent to Inmovilla API
When using the proxy, the following data is sent to Inmovilla:
api_url: From the production server.domain: From the production server.agency: From the development machine.password: From the development machine.language: From the development machine.
Testing
Run PHPUnit tests to validate functionality:
./vendor/bin/phpunit --testdox
Contribution
- Fork the repository.
- Create a new branch (
git checkout -b feature/new-feature). - Commit your changes (
git commit -m 'Add new feature'). - Push to your branch (
git push origin feature/new-feature). - Open a pull request.
License
This project is licensed under the MIT License.
Credits
- Author: Iñigo Aldama Gómez
- Inmovilla API Client Repository: inmovilla-api-client
inigo-aldama/inmovilla-api-proxy 适用场景与选型建议
inigo-aldama/inmovilla-api-proxy 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 41 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 12 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「proxy」 「real estate」 「api-proxy」 「inmovilla」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 inigo-aldama/inmovilla-api-proxy 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 inigo-aldama/inmovilla-api-proxy 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 inigo-aldama/inmovilla-api-proxy 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Lazy loading for middleware and request handlers
Get the real ip for laravel applications behind cloudflare's reverse proxy
Send events to a websocket real time engine though PHP
PHP library for Broadcastt HTTP API
Zend Framework 2 module for interacting with the Pusher REST API, built on top of ZfrPusher
Send events to a websocket real time engine though PHP
统计信息
- 总下载量: 41
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-19