Both is possible. If you integrate Steamworks into your project, it helps you to establish a peer-to-peer network between two steam users. You can also use some other fancy features like matchmaking and achievements. It’s quite easy to use. Please have a look here and here.