(bindAddr: string)
| 785 | } |
| 786 | |
| 787 | function parseBindAddr(bindAddr: string): Addr { |
| 788 | const u = new URL(`http://${bindAddr}`) |
| 789 | return { |
| 790 | host: u.hostname, |
| 791 | // With the http scheme 80 will be dropped so assume it's 80 if missing. |
| 792 | // This means --bind-addr <addr> without a port will default to 80 as well |
| 793 | // and not the code-server default. |
| 794 | port: u.port ? parseInt(u.port, 10) : 80, |
| 795 | } |
| 796 | } |
| 797 | |
| 798 | interface Addr { |
| 799 | host: string |