@@ -72,7 +72,8 @@ func Run() (err error) {
72
72
& cli.BoolFlag {Name : "no-local" , Usage : "disable local relay when sending" },
73
73
& cli.BoolFlag {Name : "no-multi" , Usage : "disable multiplexing" },
74
74
& cli.BoolFlag {Name : "git" , Usage : "enable .gitignore respect / don't send ignored files" },
75
- & cli.StringFlag {Name : "ports" , Value : "9009,9010,9011,9012,9013" , Usage : "ports of the local relay (optional)" },
75
+ & cli.IntFlag {Name : "port" , Value : 9009 , Usage : "base port for the relay" },
76
+ & cli.IntFlag {Name : "transfers" , Value : 4 , Usage : "number of ports to use for transfers" },
76
77
},
77
78
HelpName : "croc send" ,
78
79
Action : send ,
@@ -174,10 +175,21 @@ func send(c *cli.Context) (err error) {
174
175
setDebugLevel (c )
175
176
comm .Socks5Proxy = c .String ("socks5" )
176
177
comm .HttpProxy = c .String ("connect" )
177
- portsString := c .String ("ports" )
178
- if portsString == "" {
179
- portsString = "9009,9010,9011,9012,9013"
178
+
179
+ portParam := c .Int ("port" )
180
+ if portParam == 0 {
181
+ portParam = 9009
182
+ }
183
+ transfersParam := c .Int ("transfers" )
184
+ if transfersParam == 0 {
185
+ transfersParam = 4
180
186
}
187
+
188
+ ports := make ([]string , transfersParam + 1 )
189
+ for i := 0 ; i <= transfersParam ; i ++ {
190
+ ports [i ] = strconv .Itoa (portParam + i )
191
+ }
192
+
181
193
crocOptions := croc.Options {
182
194
SharedSecret : c .String ("code" ),
183
195
IsSender : true ,
@@ -189,7 +201,7 @@ func send(c *cli.Context) (err error) {
189
201
DisableLocal : c .Bool ("no-local" ),
190
202
OnlyLocal : c .Bool ("local" ),
191
203
IgnoreStdin : c .Bool ("ignore-stdin" ),
192
- RelayPorts : strings . Split ( portsString , "," ) ,
204
+ RelayPorts : ports ,
193
205
Ask : c .Bool ("ask" ),
194
206
NoMultiplexing : c .Bool ("no-multi" ),
195
207
RelayPassword : determinePass (c ),
0 commit comments