File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 22
22
version = flag .Bool ("version" , false , "Prints program version" )
23
23
networkAddress = flag .String ("address" , "localhost" , "The address of the board" )
24
24
networkPort = flag .String ("port" , "80" , "The board needs to be listening on this port" )
25
+ username = flag .String ("username" , "" , "Username for authentication" )
26
+ password = flag .String ("password" , "" , "Password for authentication" )
25
27
sketchPath = flag .String ("sketch" , "" , "Sketch path" )
26
28
uploadEndpoint = flag .String ("upload" , "" , "Upload endpoint" )
27
29
resetEndpoint = flag .String ("reset" , "" , "Upload endpoint" )
@@ -141,6 +143,10 @@ func main() {
141
143
}
142
144
req .Header .Set ("Content-Type" , "application/x-www-form-urlencoded" )
143
145
146
+ if len (* username ) > 0 && len (* password ) != 0 {
147
+ req .SetBasicAuth (* username , * password )
148
+ }
149
+
144
150
resp , err := http .DefaultClient .Do (req )
145
151
if err != nil {
146
152
if * verbose {
You can’t perform that action at this time.
0 commit comments