Giter Club home page Giter Club logo

ssmgr-trojan-client's Introduction

Hi there πŸ‘‹

  • πŸ”­ I'm currently self-employed as a full stack web developer.
  • πŸ˜„ I'm using React, Typescript and GraphQL.
  • 🌱 I'm learning Rust.

GitHub stats Top Langs

ssmgr-trojan-client's People

Contributors

codacy-badger avatar dependabot-preview[bot] avatar dependabot[bot] avatar fossabot avatar gyteng avatar llc1123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ssmgr-trojan-client's Issues

ζ–°η‰ˆθΏθ‘Œι”™θ――

/usr/lib/node_modules/ssmgr-trojan-client/dist/config.js:25
addr: options.listenAddress?.split(':')[0] || '0.0.0.0',
^

SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/usr/lib/node_modules/ssmgr-trojan-client/dist/app.js:7:18)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

dosen't seem to be compatible with trojan database requirement?

version: 1.3.2
databse: mysql
Trojan: trojan-gfw/trojan
ssmgr: 0.36.68

CREATE TABLE users (
    id INT UNSIGNED NOT NULL AUTO_INCREMENT,
    username VARCHAR(64) NOT NULL,
    password CHAR(56) NOT NULL,
    quota BIGINT NOT NULL DEFAULT 0,
    download BIGINT UNSIGNED NOT NULL DEFAULT 0,
    upload BIGINT UNSIGNED NOT NULL DEFAULT 0,
    PRIMARY KEY (id),
    INDEX (password)
);

username is the mandatory field, but instead, ssmgr-trojan-client is try to use the "port".

ssmgr-trojan-client log shown as below:

 [INFO] default - Message received: {"command":"add","port":60029,"password":"14f4ffe8604ab780b25bc729eb0c708f1b47f9dbbd4350c43aad8f7a"}
 [ERROR] default - Query error on 'add': ER_NO_DEFAULT_FOR_FIELD: Field 'username' doesn't have a default value

version: 1.3.2
database: Redis
Trojan: trojan-gfw/trojan
ssmgr: 0.36.68

With the same configuration but Redis, I get "incorrect password", probably due to the same reason as the the mysql compliants about the "port" instead of "username", so the trojan can't read the correct password?

Or maybe my misconfiguration?

Trojan log shown as below:

[ALL] 127.0.0.1:33912 incoming connection
[WARN] 127.0.0.1:33912 valid trojan request structure but possibly incorrect password (6c7f83d212bf6be15b78927895f9786c6c2d827979a7e57951b96114)

For clearance and less wasted hours on trojan's redis supports

None of the wikis from both ssmgr project and trojan project had any clearance of how ssmgr supported redis for trojan.
Let me clear those misleading for you, and you won't need wasting hours looking for answers which you will never get from the wiki.

  1. The trojan-gfw/trojan doesn't support redis.
  2. The DenrianWeiss/trojan-cluster does support redis.
  3. The correct config file for "redis" is shown below
  4. The correct partial nginx config file for trojan behind nginx is also list below.
  5. The correct cmd is ssmgr-trojan-client -l 127.0.0.1:4002 -k 123456
  6. After step 5 you need to start trojan separately like this trojan -c /home/ubuntu/.ssmgr/trojan_config.your.domain.json

trojan_config.your.domain.json

{
    "run_type": "server",
    "local_addr": "127.0.0.1",
    "local_port": 2443, 
    "remote_addr": "127.0.0.1",
    "remote_port": 80,
    "password": [
        "FixedPassword1",
        "FixedPassword2"
    ],
    "log_level": 0,
    "ssl": {
        "cert": "/home/ubuntu/.acme.sh/your.domain/fullchain.cer",
        "key": "/home/ubuntu/.acme.sh/your.domain/your.domain.key",
        "key_password": "",
        "cipher": "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384",
        "cipher_tls13": "TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384",
        "prefer_server_cipher": true,
        "alpn": [
            "http/1.1"
        ],
        "alpn_port_override": {
            "h2": 81
        },
        "reuse_session": true,
        "session_ticket": false,
        "session_timeout": 600,
        "plain_http_response": "",
        "curves": "",
        "dhparam": ""
    },
    "tcp": {
        "prefer_ipv4": false,
        "no_delay": true,
        "keep_alive": true,
        "reuse_port": false,
        "fast_open": true,
        "fast_open_qlen": 20
    },
	"redis": {
        "enabled": true,
        "server_addr": "localhost",
        "server_port": 6379,
        "password": ""
	},
    "mysql": {
        "enabled": false,
        "server_addr": "10.0.0.45",
        "server_port": 3306,
        "database": "trojan",
        "username": "trojan",
        "password": "thisisthetrojandbpassword",
        "cafile": ""
    }
}

Sharing nginx with trojan and mtproto.
nginx.conf

stream {

    #------------------------------
    server {
        listen 443;
        listen [::]:443;
        proxy_pass $name;
        proxy_protocol on; # Key step support HAProxy proxy_protocol
        ssl_preread on; # preread SNI hostname

        access_log /var/log/nginx/stream_access.log streamlog;
        error_log  /var/log/nginx/stream_error.log; # Health check notifications
    }
    
    map $ssl_preread_server_name $name {
		trojan.your.domain trojan_pre;
                www.dummpysite.com mtproxy;

                "~^cget\d{0,1}\.your\.domain $" LocalBackEnd;

        default LocalBackEnd;
    }

    #------------------------------
    upstream trojan_pre {
        server 127.0.0.1:2442;
    }

    server {
        listen localhost:2442 reuseport proxy_protocol;
        proxy_pass trojan;
    }
    
    upstream trojan {
        server 127.0.0.1:2443;
    }
    #------------------------------
    upstream mtproxy {
        server 127.0.0.1:3443;
    }
    #------------------------------
    upstream LocalBackEnd {
        server localhost:1443; # temp server
    }

}

http {
     .....
     include /etc/nginx/sites-enabled/*;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.