MCPcopy Index your code
hub / github.com/coder/code-server / parseBindAddr

Function parseBindAddr

src/node/cli.ts:787–796  ·  view source on GitHub ↗
(bindAddr: string)

Source from the content-addressed store, hash-verified

785}
786
787function 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
798interface Addr {
799 host: string

Callers 1

bindAddrFromArgsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected