Changing a PySocks Setting Does Not Move an Open Connection
Separate a PySocks socket's future proxy settings from the established connection and prefer a fresh socket when choosing another route.
set_proxy stores the proxy configuration a PySocks socket uses when establishing its connection. It does not migrate a live stream from one intermediary to another.
Once a connection is open, its bytes belong to that established path. Clearing the stored proxy configuration is not a request to move the connection directly to the destination, and changing the address does not move it to a new exit.
For another route, create a fresh socket, configure it deliberately, and establish a new destination connection. Close the old socket through the application's normal lifecycle.
Keep per-socket settings separate from a global default or monkey-patching of the socket module. Global changes can affect later sockets in other code without explaining what an existing socket is already doing.
If an application protocol needs a continuous session, reconnecting also needs that protocol's recovery logic. A fresh TCP path and another public IP do not automatically preserve the application's transaction or authenticated state.