Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/openiothub/server-go
🎨OpenIoTHub Server[内网穿透和物联网设备管理服务器]
https://github.com/openiothub/server-go
arduino esp32 esp8266 frp go golang goreleaser iot iothub mux nat nps open openiothub server tunnel tunnel-server
Last synced: 25 days ago
JSON representation
🎨OpenIoTHub Server[内网穿透和物联网设备管理服务器]
- Host: GitHub
- URL: https://github.com/openiothub/server-go
- Owner: OpenIoTHub
- License: mit
- Created: 2019-03-28T06:39:34.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-24T15:07:32.000Z (2 months ago)
- Last Synced: 2024-10-11T05:03:32.417Z (25 days ago)
- Topics: arduino, esp32, esp8266, frp, go, golang, goreleaser, iot, iothub, mux, nat, nps, open, openiothub, server, tunnel, tunnel-server
- Language: Go
- Homepage:
- Size: 17.5 MB
- Stars: 179
- Watchers: 5
- Forks: 27
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Server for OpenIoTHub
[![Build Status](https://travis-ci.com/OpenIoTHub/server-go.svg?branch=master)](https://travis-ci.com/OpenIoTHub/server-go)[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-white.svg)](https://snapcraft.io/server-go)
## OpenIoTHub 物联网服务器### 如果你有自建转发服务端的需求则可以自建此服务端,服务器需要同时开启指定的TCP,UDP端口
#### 建好此服务器之后,[网关](https://github.com/OpenIoTHub/gateway-go/releases )就可以连接自建的服务器了!```
如果使用redis持久化保存Http代理配置请将配置文件中的redis的使能打开enabled: true
```
```
如果使用redis后OpenIoTHub App无法添加http代理成功请尝试在redis-cli中执行config set stop-writes-on-bgsave-error no
参考:https://www.baidu.com/s?ie=UTF-8&wd=MISCONF Redis is configured to save RDB snapshots
127.0.0.1:6379> config set stop-writes-on-bgsave-error no
如果配置redis后正常使用请忽略本条问题
``````yaml
my_public_ip_or_domian: "" #你运行本软件的服务器的域名或者ip地址,用来使用命令生成token时有用
logconfig:
enablestdout: true #是否输出日志到控制台
logfilepath: "./mylog.log" #配置日志输出文件的位置,空则不输出到文件
common:
bind_addr: 0.0.0.0 #服务器监听的IP地址,默认监听所有
tcp_port: 34320 #服务器使用的tcp端口
kcp_port: 34320 #服务器使用的kcp(实际上是udp)端口
udp_p2p_port: 34321 #服务器使用的UDP端口,用于辅助p2p
kcp_p2p_port: 34322 #服务器使用的kcp(UDP)端口,用于辅助p2p
tls_port: 34321 #服务器使用的tls(实际上是tcp)端口,用于安全通信
grpc_port: 34322 #服务器使用的grpc(实际上是tcp)端口,用于grpc通信
http_port: 80 #服务器监听的http(tcp)端口,用于提供http代理功能
https_port: 443 #服务器监听的https(tcp)端口,用于提供https代理功能
security:
login_key: HLLdsa544&*S #用户自定义的服务器秘钥,此为默认,用户个人使用服务器请修改
tls_Cert_file_path: ""
tls_key_file_path: ""
https_cert_file_path: ""
https_key_file_path: ""
redisconfig:
enabled: false #是否使用redis保存用户http代理配置 <----这里打开redis
network: tcp #redis使用tcp连接,默认即可
address: 127.0.0.1:6379 #redis的地址,默认本机,redis默认端口6379,请根据自己的redis配置
database: 0 #redis的默认服务器0,如果你不懂请保持0
needAuth: false #redis是否需要密码验证,默认不需要false,如果你的redis需要密码请将false改为true并配置下面password为redis密码
password: "" #redis的密码,needAuth:true时有效
```You can install the pre-compiled binary (in several different ways),
use Docker.Here are the steps for each of them:
## Install the pre-compiled binary
**homebrew tap** (only on macOS for now):
```sh
$ brew install OpenIoTHub/tap/server-go
```**homebrew** (may not be the latest version):
```sh
$ brew install server-go
```
homebrew pr [server-go](https://github.com/Homebrew/homebrew-core/blob/master/Formula/server-go.rb)
```text
*** config file :
/usr/local/etc/server-go/server-go.yaml
```**snapcraft**:
```sh
$ sudo snap install server-go
```
```text
*** config file :
/root/snap/server-go/current/server-go.yaml
```**scoop**:
```sh
$ scoop bucket add OpenIoTHub https://github.com/OpenIoTHub/scoop-bucket.git
$ scoop install server-go
```**deb/rpm**:
Download the `.deb` or `.rpm` from the [releases page][releases] and
install with `dpkg -i` and `rpm -i` respectively.
```text
*** config file :
/etc/server-go/server-go.yaml
```**Shell script**:
```sh
$ curl -sfL https://install.goreleaser.com/github.com/OpenIoTHub/server-go.sh | sh
```**manually**:
Download the pre-compiled binaries from the [releases page][releases] and
copy to the desired location.## Running with Docker
You can also use it within a Docker container. To do that, you'll need to
execute something more-or-less like the following:```sh
$ docker run openiothub/server:latest
```Note that the image will almost always have the last stable Go version.
[releases]: https://github.com/OpenIoTHub/server-go/releases