Just to demonstrate something, I wanted to connect a light socket to a switch, that is connected to an electrical cord that gets plugged into a wall outlet. The switch is a standard single-pole light switch.
The way I have it wired does work. The breaker doesn't trip and nothing seems to be getting hot (tested with thermal imaging camera).
I'm guessing this isn't up to code, but is this configuration relatively safe? The neutrals that are connected together are part of the same circuit.
Here's the actual wiring configuration...
The neutral from the electrical cord and neutral from the light socket are connected together with a wire nut.
The hot from the electrical cord and hot from the light socket are connected to the terminals on the switch.
The ground from the electrical cord is connected to the ground nut on the switch.
All wires are 14 AWG.
Thanks for the help!