diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 566a4a5..603f7f2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -94,9 +94,9 @@ jobs: name: elex-proxy-Darwin-aarch64.tar.gz skip_tests: true toolchain: - - stable +# - stable # - beta -# - nightly + - nightly steps: - uses: actions/checkout@v3 - name: Cache cargo & target directories @@ -129,26 +129,18 @@ jobs: tar czvf ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }} fi cd - - if: | - matrix.toolchain == 'stable' && - ( startsWith( github.ref, 'refs/tags/v' ) || - github.ref == 'refs/tags/test-release' ) + if: startsWith( github.ref, 'refs/tags/v' ) - name: Publish release artifacts uses: actions/upload-artifact@v3 with: name: elex-proxy-${{ matrix.platform.os_name }} path: "elex-proxy-*" - if: matrix.toolchain == 'stable' && github.ref == 'refs/tags/test-release' - name: Generate SHA-256 run: shasum -a 256 ${{ matrix.platform.name }} - if: | - matrix.toolchain == 'stable' && - matrix.platform.os == 'macOS-latest' && - ( startsWith( github.ref, 'refs/tags/v' ) || - github.ref == 'refs/tags/test-release' ) + if: matrix.platform.os == 'macOS-latest' && startsWith( github.ref, 'refs/tags/v' ) - name: Publish GitHub release uses: softprops/action-gh-release@v1 with: draft: true files: "elex-proxy-*" - if: matrix.toolchain == 'stable' && startsWith( github.ref, 'refs/tags/v' ) \ No newline at end of file + if: startsWith( github.ref, 'refs/tags/v' ) \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c6899b..65829b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.2 + +- Add `/proxy/health`. + ## 0.1.1 - Allowing without parameter. diff --git a/Cargo.toml b/Cargo.toml index 7edb354..a5009d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "elex-proxy" -version = "0.1.1" +version = "0.1.2" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/README-ZH.md b/README-ZH.md index 59fdae0..739d3c8 100644 --- a/README-ZH.md +++ b/README-ZH.md @@ -1,9 +1,9 @@ ### EleX Proxy ( [English](README.md) | 中文文档 ) ![GitHub release (with filter)](https://img.shields.io/github/v/release/AstroxNetwork/elex-proxy) -[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/AstroxNetwork/elex-proxy/blob/main/LICENSE) +[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) -**EleX Proxy** 代理是一个轻量级的 Rust 实现,用于代理与 [ElectrumX](https://github.com/atomicals/atomicals-electrumx) 服务器的通信。该项目旨在为处理 ElectrumX 请求提供简单而高效的解决方案。 +**EleX Proxy** 代理是一个轻量级的 Rust 实现,用于代理与 [Atomicals ElectrumX](https://github.com/atomicals/atomicals-electrumx) 服务器的通信。该项目旨在为处理 ElectrumX 请求提供简单而高效的解决方案。 #### 安装 @@ -26,6 +26,8 @@ IP_LIMIT_PER_SECOND=1 IP_LIMIT_BURST_SIZE=10 # 默认 500,最大并发连接数 CONCURRENCY_LIMIT=500 +# 默认 10,接收 WebSocket 消息的超时时间 +RESPONSE_TIMEOUT=10 RUST_LOG=info ``` @@ -34,8 +36,9 @@ RUST_LOG=info - `PROXY_HOST`:代理服务器监听的主机和端口。 - `ELECTRUMX_WSS`:要连接的 ElectrumX 服务器。使用逗号分隔多个服务器。 - `IP_LIMIT_PER_SECOND`:间隔几秒添加新的容量。 -- `IP_LIMIT_BURST_SIZE`:如果在 `IP_LIMIT_PER_SECOND` 设置的时间内突发超过这个值,将会被限制 +- `IP_LIMIT_BURST_SIZE`:如果在 `IP_LIMIT_PER_SECOND` 设置的时间内突发超过这个值,将会被限制。 - `CONCURRENCY_LIMIT`:允许的最大并发连接数。 +- `RESPONSE_TIMEOUT`:接收 WebSocket 消息的超时时间。 - `RUST_LOG`:Rust 日志框架的日志级别。选项包括 `trace`、`debug`、`info`、`warn` 和 `error`。 #### 使用 @@ -44,6 +47,6 @@ RUST_LOG=info ### 许可 -本项目采用 MIT 许可证 - 有关详细信息,请参阅 [LICENSE](https://github.com/atomicals/electrumx-proxy/blob/main/LICENSE) 文件。 +本项目采用 MIT 许可证 - 有关详细信息,请参阅 [LICENSE](LICENSE) 文件。 **注意:** 建议审查并根据您的特定需求定制配置。 \ No newline at end of file diff --git a/README.md b/README.md index ef86dba..3216db6 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,19 @@ ### EleX Proxy ( English | [中文文档](README-ZH.md) ) ![GitHub release (with filter)](https://img.shields.io/github/v/release/AstroxNetwork/elex-proxy) -[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/AstroxNetwork/elex-proxy/blob/main/LICENSE) +[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) -**EleX Proxy** stands as a sophisticated Rust implementation, meticulously crafted to serve as a proxy for seamless communication with [ElectrumX](https://github.com/atomicals/atomicals-electrumx) servers. This software project has been developed with precision to offer an advanced and efficient solution for managing ElectrumX requests. +**EleX Proxy** is a lightweight Rust implementation designed to proxy communication with the [Atomicals ElectrumX](https://github.com/atomicals/atomicals-electrumx) server. This project aims to provide a simple and efficient solution for handling ElectrumX requests. #### Installation -1. Visit the [GitHub Releases](https://github.com/AstroxNetwork/elex-proxy/releases) page to acquire the latest release. -2. Download the compressed archive tailored for your platform. -3. Extract the archive and execute the provided binary. +1. Open the [GitHub Releases](https://github.com/AstroxNetwork/elex-proxy/releases) page to download the latest version. +2. Download the compressed archive for your platform. +3. Extract and run the executable file. #### Configuration -Create a `.env` file in the project's root directory, populating it with the following configuration: +Create a file named `.env` in the project's root directory with the following content: ```dotenv # Host and port on which the proxy server will listen @@ -26,24 +26,27 @@ IP_LIMIT_PER_SECOND=1 IP_LIMIT_BURST_SIZE=10 # Default 500, maximum concurrent connections CONCURRENCY_LIMIT=500 +# Default 10, timeout for receiving WebSocket messages +RESPONSE_TIMEOUT=10 RUST_LOG=info ``` -Adjust the values to align with your requirements. Below is a concise explanation of the configuration parameters: +Adjust these values as needed. Here's a brief explanation of the configuration parameters: - `PROXY_HOST`: The host and port on which the proxy server will listen. - `ELECTRUMX_WSS`: ElectrumX server(s) to connect to. Use commas to separate multiple servers. -- `IP_LIMIT_PER_SECOND`: The interval in seconds to add new capacity. -- `IP_LIMIT_BURST_SIZE`: The burst size; if bursts exceed this value within the time set in `IP_LIMIT_PER_SECOND`, it will be restricted. +- `IP_LIMIT_PER_SECOND`: Interval in seconds to add new capacity. +- `IP_LIMIT_BURST_SIZE`: Burst size; if bursts exceed this value within the time set in `IP_LIMIT_PER_SECOND`, it will be restricted. - `CONCURRENCY_LIMIT`: The maximum number of concurrent connections allowed. +- `RESPONSE_TIMEOUT`: Timeout for receiving WebSocket messages. - `RUST_LOG`: Log level for Rust's logging framework. Options include `trace`, `debug`, `info`, `warn`, and `error`. #### Usage -Once the proxy server is operational, it adeptly forwards ElectrumX requests to the specified server(s). If multiple servers are configured, it seamlessly switches to the next server after a disconnection. Clients can effortlessly connect to the configured `PROXY_HOST`. +Once the proxy server is running, it adeptly forwards ElectrumX requests to the specified server(s). If multiple servers are configured, it seamlessly switches to the next server after a disconnection. Clients can effortlessly connect to the configured `PROXY_HOST`. ### License -This project operates under the MIT License - refer to the [LICENSE](https://github.com/atomicals/electrumx-proxy/blob/main/LICENSE) file for comprehensive details. +This project is released under the MIT License - for detailed information, please refer to the [LICENSE](LICENSE) file. -**Note:** It is advised to scrutinize and tailor the configuration according to your specific demands. \ No newline at end of file +**Note:** It is advised to review and customize the configuration according to your specific requirements. \ No newline at end of file