  We give a probabilistic representation of a one-dimensional diffusion
equation where the solution is discontinuous at $0$ with a jump proportional to
its flux. This kind of interface condition is usually seen as a semi-permeable
barrier. For this, we use a process called here the snapping out Brownian
motion, whose properties are studied. As this construction is motivated by
applications, for example, in brain imaging or in chemistry, a simulation
scheme is also provided.
