You don't put the camera on the eyepiece, the camera becomes the eyepiece. I've used my DSLR for decades with my scope, until I bought a real astro cam.
Usually it's a combination of a T-ring to adapt the camera lens mounting system into a generic screw form. Then a T adaptor gets screwed into that, which is basically a small little tube with the diameter of the hole the eyepiece goes in.
On some of my scopes the hole is large, with a piece that slots in and allows for small eyepiece to be placed. When I remove all of that I'm left with a large hole to fit in the T adaptor. This is important as it allows the entire sensor to receive light.
There's also an extra piece one could screw on called a coma corrector. This is an extra lens that reduces distortion due to the optics of the scope and of the camera not being exactly compatible. But these reduce light throughput and can cause vignettes, but some people swear by them.
These are all very cheap components (relative to all the other astro photography stuff) and they are easily available.