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 2222 version = flag .Bool ("version" , false , "Prints program version" )
2323 networkAddress = flag .String ("address" , "localhost" , "The address of the board" )
2424 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" )
2527 sketchPath = flag .String ("sketch" , "" , "Sketch path" )
2628 uploadEndpoint = flag .String ("upload" , "" , "Upload endpoint" )
2729 resetEndpoint = flag .String ("reset" , "" , "Upload endpoint" )
@@ -141,6 +143,10 @@ func main() {
141143 }
142144 req .Header .Set ("Content-Type" , "application/x-www-form-urlencoded" )
143145
146+ if len (* username ) > 0 && len (* password ) != 0 {
147+ req .SetBasicAuth (* username , * password )
148+ }
149+
144150 resp , err := http .DefaultClient .Do (req )
145151 if err != nil {
146152 if * verbose {
You can’t perform that action at this time.
0 commit comments