Is it possible, legally, for code to be publicly available online, but have copyright protection?
Can publicly accessible code be closed source?
closed source
Yes. Having access to source code does not give permission to redistribute. Here is an analogy: Think about photos on Flickr, just because you can view them doesn't mean you can redistribute them. For example: Several hardware companies will make code available to use with their hardware, but the license will say only their hardware. It doesn't meet the OSI definition of open source, and you can use it in a limited fashion. Why are you asking? Is this something you've seen or what to do. 