<commit_before>/* 
 * WebSocketConfig.java 
 * 
 * Version: 
 *     $Id$ 
 * 
 * Revisions: 
 *     $Log$ 
 */
package edu.tamu.framework.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;

/** 
 * Web Socket Configuration.
 * 
 * @author
 *
 */
@Configuration
@EnableWebSocketMessageBroker
public abstract class CoreWebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
	
	/**
	 * Configure message broker. Enables simple broker queue and channel. 
	 * Sets prefix ws and user destination prefix privat.
	 * 
	 * @param       registry    	MessageBrokerRegistry
	 * 
	 */
	@Override
	public void configureMessageBroker(MessageBrokerRegistry registry) {
		registry.enableSimpleBroker("/queue", "/channel");
		registry.setApplicationDestinationPrefixes("/ws");
		registry.setUserDestinationPrefix("/private");
	}
	
	/**
	 * Register Stomp endpoints connect, user, and broadcast.
	 * 
	 * @param       registry    	StompEndpointRegistry
	 * 
	 */
	@Override
	public void registerStompEndpoints(StompEndpointRegistry registry) {
		registry.addEndpoint("/connect").withSockJS();
		registry.addEndpoint("/user").withSockJS();
		registry.addEndpoint("/admin").withSockJS();
	}
	
}
<commit_msg>Added allow origins for websockets. Required with new spring boot release.<commit_after>/* 
 * WebSocketConfig.java 
 * 
 * Version: 
 *     $Id$ 
 * 
 * Revisions: 
 *     $Log$ 
 */
package edu.tamu.framework.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;

/** 
 * Web Socket Configuration.
 * 
 * @author
 *
 */
@Configuration
@EnableWebSocketMessageBroker
public abstract class CoreWebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
	
	/**
	 * Configure message broker. Enables simple broker queue and channel. 
	 * Sets prefix ws and user destination prefix privat.
	 * 
	 * @param       registry    	MessageBrokerRegistry
	 * 
	 */
	@Override
	public void configureMessageBroker(MessageBrokerRegistry registry) {
		registry.enableSimpleBroker("/queue", "/channel");
		registry.setApplicationDestinationPrefixes("/ws");
		registry.setUserDestinationPrefix("/private");
	}
	
	/**
	 * Register Stomp endpoints connect, user, and broadcast.
	 * 
	 * @param       registry    	StompEndpointRegistry
	 * 
	 */
	@Override
	public void registerStompEndpoints(StompEndpointRegistry registry) {
		registry.addEndpoint("/connect").setAllowedOrigins("*").withSockJS();
		registry.addEndpoint("/user").setAllowedOrigins("*").withSockJS();
		registry.addEndpoint("/admin").setAllowedOrigins("*").withSockJS();
	}
	
}

{'fraction_non_alphanumeric': 0.10754017305315204, 'fraction_numerical': 0.0, 'mean_word_length': 4.698943661971831, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1697607', 'n_tokens_mistral': 941, 'n_tokens_neox': 859, 'n_words': 164}