当使用wss://时,URL本身也是加密的吗?例如,假设您有一个简单的Sinatra web应用程序,它接受web套接字连接:
class App < Sinatra::Base
get "/ws/:api_key/room/:id" do |api_key, id|
user = User.find_by(api_key: api_key)
room = Room.find(id)
if RoomAuthenticator.new(room).authorized?(user)
request.websocket do |ws