Running gost as a service at Alpine Linux
在Alpine Linux上运行socks5服务

Alpine的服务由 openrc 管理,下载gost的二进制文件后扔在/usr/local/bin

/etc/init.d/gost

#!/sbin/openrc-run
supervisor=supervise-daemon
command="/usr/local/bin/gost"
name=$(basename $(readlink -f $command))
supervise_daemon_args="--stdout /var/log/${name}.log --stderr /var/log/${name}.err"

depend() {
        After=syslog.target network-online.target
}

/etc/gost/gost.yaml

services:
- name: service-0
  addr: :1080
  handler:
    type: socks5
  listener:
    type: tcp
crazy:~# chmod +x /etc/init.d/gost
crazy:~# rc-update add gost
 * service gost added to runlevel default
crazy:~# rc-service gost start
 * Starting gost ...               [ ok ]
crazy:~# netstat -anp | grep gost
tcp 0 0 :::1080 :::*  LISTEN      17133/gost

参考资料:

  1. https://gost.run/tutorials/protocols/socks/
  2. https://www.cnblogs.com/jonnyan/p/13462113.html
  3. https://github.com/go-gost/gost/

最后修改于 Sat, 18 Feb 2023