我在我的应用程序中使用websocket,当我使用localhost时一切正常.问题开始时,我将localhost更改为我的服务器IP地址,然后我收到此错误: WebSocket握手期间出错:意外的响应代码:404
这是我的httpd.conf
...
听25.48.63.220:80
听25.48.63.220:8081
...
ServerName 25.48.63.220:80
...
我认为我能够连接我的服务器,因为当我键入错误的IP地址时,我不会收到此错误.
还有什么需要改变的?
我有两个模型User,Task和TaskRepository,UserRepository与它们相关联.我使用spring-boot-starter-web和spring-boot-starter-data-rest软件包进行Spring启动.
@RepositoryRestResource(path="/task")
public interface TaskRepository extends CrudRepository<Task, Integer> {
}
@RepositoryRestResource(path="/user")
public interface UserRepository extends CrudRepository<User, Integer> {
}
Run Code Online (Sandbox Code Playgroud)
当我想保存新任务时,我必须通过用户.我注意到他必须以java.net.URI的身份传递,但这对我来说真的很奇怪.为什么它不能只是用户ID.有可能改变这个吗?
我已经开始在我的快递js项目中使用graphql,但我想知道如何保护我的一些GraphQL查询.以前我使用护照js(JWT),这很好用.安全路线真的很容易但是使用graphql(express-graphql)我找不到任何解决方案.此外,拥有某种基于角色的解决方案来保护特定领域将会很不错.有没有什么好的教程如何保护graphQL?