# How to get name of Wi-Fi connection

**URL:** https://discourse.julialang.org/t/how-to-get-name-of-wi-fi-connection/69299
**Category:** General Usage
**Created:** [October 6, 2021, 12:30pm UTC](https://discourse.julialang.org/t/how-to-get-name-of-wi-fi-connection/69299 "2021-10-06T12:30:29Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![lubo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lubo/32/18895_2.png) [@lubo](https://discourse.julialang.org/u/lubo)
#### Post date: [October 6, 2021, 12:30pm UTC](https://discourse.julialang.org/t/how-to-get-name-of-wi-fi-connection/69299/1 "2021-10-06T12:30:29Z")

</div>

Hi there,

I am using some code (jupyter notebook) on one machine but at two places (at home and at work). At work internet connection is behind proxy. When I set right proxy to HTTP.get function it is working just fine. But I would like to automatically find out whenever I am at work ot at home.  
Without setting proxy it is not working (is there way to automatically findou out whenever to use system proxy?).

I found a can get IP address via:  
using Sockets  
getipaddrs()

But IP addreesses are often similar and it is not possible to distinguish work and home.  
Is there any tricky how to do that? Is there a way to get somehow name of the internet connection (name of the Wifi)?

Thank you  
Lubo

---

<div class="post-metadata">

### Author: ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)
#### Post date: [October 6, 2021, 1:01pm UTC](https://discourse.julialang.org/t/how-to-get-name-of-wi-fi-connection/69299/2 "2021-10-06T13:01:20Z")

</div>

this seems not relevant to Web Stack or even Julia at all tbh.

maybe try using

```julia
julia> gethostname()

```

?

---

<div class="post-metadata">

### Author: ![Jeff\_Emanuel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff_emanuel/32/15440_2.png) [@Jeff\_Emanuel](https://discourse.julialang.org/u/Jeff_Emanuel)
#### Post date: [October 6, 2021, 7:01pm UTC](https://discourse.julialang.org/t/how-to-get-name-of-wi-fi-connection/69299/3 "2021-10-06T19:01:15Z")

</div>

This is OS specific. Search for wifi SSID and your OS and it will likely tell you a program to run. You can run that program from Julia [Running External Programs · The Julia Language](https://docs.julialang.org/en/v1/manual/running-external-programs/). You may need to call an OS specific API function. In that case, [Calling C and Fortran Code · The Julia Language](https://docs.julialang.org/en/v1/manual/calling-c-and-fortran-code/) is your friend.

---

<div class="post-metadata">

### Author: ![lubo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lubo/32/18895_2.png) [@lubo](https://discourse.julialang.org/u/lubo)
#### Post date: [October 9, 2021, 8:14am UTC](https://discourse.julialang.org/t/how-to-get-name-of-wi-fi-connection/69299/4 "2021-10-09T08:14:43Z")

</div>

Thanks for direction. I found out this solution for Win10:

cmd\_call = `Netsh WLAN show interfaces`  
interface\_info = read(cmd\_call, String)  
ssid\_name = strip(split(filter(x → occursin(" SSID", x), split(interface\_info, “\r\n”))[1], “:”)[2])

---

<div class="post-metadata">

### Author: ![herman435](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/herman435/32/222787_2.png) [@herman435](https://discourse.julialang.org/u/herman435)
#### Post date: [July 23, 2026, 9:08pm UTC](https://discourse.julialang.org/t/how-to-get-name-of-wi-fi-connection/69299/5 "2026-07-23T21:08:05Z")

</div>

I dont think Julia has a built in way to get the wifi SSID directly. A practical approach is to call the operating system (for example, nmcli on Linux, netsh wlan show interfaces on Windows, or networksetup on macOS) and read the current network name. Another option is to check whether your work proxy or a known internal host is reachable, which is usually more reliable than relying on IP addresses alone.
