Skip to content

Commit 388c0e4

Browse files
committed
Explicitly check for 'no' and 'false' in USE_SOCKET env var
This allows us to default to using unix sockets by default in the future once this feature is better tested, and allow people to turn it off if needed.
1 parent 8745ed0 commit 388c0e4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

jupyter_rsession_proxy/__init__.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,15 @@ def _get_timeout(default=15):
134134
'icon_path': get_icon_path()
135135
}
136136
}
137-
if os.getenv('JUPYTER_RSESSION_PROXY_USE_SOCKET'):
138-
server_process['unix_socket'] = True
137+
138+
use_socket = os.getenv('JUPYTER_RSESSION_PROXY_USE_SOCKET')
139+
if use_socket is not None:
140+
# If this env var is anything other than case insensitive 'no' or 'false',
141+
# use unix sockets instead of tcp sockets. This allows us to default to
142+
# using unix sockets by default in the future once this feature is better
143+
# tested, and allow people to turn it off if needed.
144+
if use_socket.casefold() not in ('no', 'false'):
145+
server_process['unix_socket'] = True
139146

140147
return server_process
141148

0 commit comments

Comments
 (0)