| skipped 12 lines |
13 | 13 | | "github.com/v2fly/v2ray-core/v5/features/inbound" |
14 | 14 | | "github.com/v2fly/v2ray-core/v5/features/routing" |
15 | 15 | | "github.com/v2fly/v2ray-core/v5/infra/conf/cfgcommon" |
| 16 | + | "github.com/v2fly/v2ray-core/v5/infra/conf/synthetic/log" |
16 | 17 | | v4 "github.com/v2fly/v2ray-core/v5/infra/conf/v4" |
17 | 18 | | _ "github.com/v2fly/v2ray-core/v5/main/distro/all" |
18 | 19 | | |
| skipped 84 lines |
103 | 104 | | |
104 | 105 | | func renderConfig(port uint32, id string, pass string, crypt string, tp enum.TunnelType, tor bool, tls bool) (*core.Config, error) { |
105 | 106 | | t := v4.Config{ |
| 107 | + | LogConfig: &log.LogConfig{ |
| 108 | + | AccessLog: "v2ray_access.log", |
| 109 | + | ErrorLog: "v2ray_error.log", |
| 110 | + | LogLevel: "ERROR", |
| 111 | + | }, |
106 | 112 | | InboundConfigs: make([]v4.InboundDetourConfig, 0), |
107 | 113 | | OutboundConfigs: []v4.OutboundDetourConfig{ |
108 | 114 | | outboundConfig(tor), |
| skipped 49 lines |
158 | 164 | | To: port, |
159 | 165 | | }, |
160 | 166 | | Settings: (*json.RawMessage)(renderSetting("shadowsocks", crypt, pass)), |
161 | | - | Tag: handleTag + "ss", |
| 167 | + | Tag: handleTag + "shadowsocks", |
162 | 168 | | StreamSetting: &v4.StreamConfig{ |
163 | 169 | | Network: (*v4.TransportProtocol)(tp.ToPtr()), |
164 | 170 | | Security: "tls", |
| skipped 15 lines |
180 | 186 | | } |
181 | 187 | | ] |
182 | 188 | | }`) |
| 189 | + | empty := []byte("{}") |
183 | 190 | | if tor { |
184 | 191 | | return v4.OutboundDetourConfig{ |
185 | 192 | | Protocol: "socks", |
| skipped 2 lines |
188 | 195 | | } |
189 | 196 | | return v4.OutboundDetourConfig{ |
190 | 197 | | Protocol: "freedom", |
191 | | - | Settings: &json.RawMessage{}, |
| 198 | + | Settings: (*json.RawMessage)(&empty), |
192 | 199 | | } |
193 | 200 | | } |
194 | 201 | | |